mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix incorrect behavior of 'cd ../.foo' (#46)
The cd builtin was removing '.' from directory names when combined
with a preceding '../', which caused commands like 'cd ../.local'
to become 'cd ../local'. This patch fixes the problem by limiting
the extra handling to leading '..'. The bugfix comes from ksh93v-
2013-10-10-alpha, although this version is a shortened patch from
Solaris (as ksh93v- refactored a decent amount of the code for the
cd builtin).
src/cmd/ksh93/bltins/cd_pwd.c:
- cd should only check for leading '..', as trying to handle a lone
'.' only causes problems.
src/cmd/ksh93/tests/builtins.sh:
- Add a regression test for this problem based on the test present in
ksh93v- 2013-10-10-alpha.
Patch from Solaris:
860d27f/components/ksh93/patches/270-23319761.patch
This commit is contained in:
parent
eaaa0de74d
commit
bb4745e897
4 changed files with 27 additions and 27 deletions
|
@ -717,5 +717,14 @@ chmod is $(whence -p chmod)
|
|||
chmod is a tracked alias for $(whence -p chmod)"
|
||||
[[ $actual == $expected ]] || err_exit '`whence -a` does not work correctly with tracked aliases'
|
||||
|
||||
# ======
|
||||
# 'cd ../.foo' should not exclude the '.' in '.foo'
|
||||
(
|
||||
cd "$tmp"
|
||||
mkdir foo .bar
|
||||
cd foo
|
||||
cd ../.bar
|
||||
) || err_exit 'cd ../.bar when ../.bar exists should not fail'
|
||||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue