| Summary: | lineedit: \w uses getcwd which canonicalizes symlinks (diff PS1=\w behavior between busybox & bash) | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Santosh <ysan99> |
| Component: | Other | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.20.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Santosh
2015-04-03 11:37:45 UTC
the reason bash works is that it replaces \w with $PWD. this is the same reason the *builtin* pwd works for both busybox & bash. (actually, it uses the internal curdir setting that has been validated rather than the explicit $PWD envvar.) the reason busybox fails w/PS1 is that it has a common lineedit library that it uses with all applets that need line editing capabilities. so when it parses \w, it will run getcwd() and that is the real path (target of the symlink). if you run `/bin/pwd` in either env, you'll get the same result because they too don't have access to the internal shell state -- you'll get /hdd1/test. i think we should just mark this as a known deviation. lineedit doesn't have access to the shell state, and grabbing PWD from the env would also be wrong (and shells aren't required to export it). |