From: SourceForge.net <no...@so...> - 2012-09-21 11:56:52
|
Bugs item #3570244, was opened at 2012-09-20 14:26 Message generated for change (Comment added) made by wastl-nagel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3570244&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 37. File System Group: obsolete: 8.5.11 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sebastian Nagel (wastl-nagel) Assigned to: Don Porter (dgp) Summary: "cd .." behaves wrong if last element in pwd is a symlink Initial Comment: If the last element of a the current path (pwd) is a symbolic link with a trailing slash the command cd .. does not change into the parent directory but stays in the current directory. In addition, when the link target is a relative path containing ".." or "." the pwd after "cd .." may require normalization. Related / possible duplicate of "cd .. from link in Windows confuses Tcl - ID: 3183016" bash> pwd /tmp/test bash> mkdir /tmp/dir bash> ln -sf /tmp/dir link_abs bash> tclsh % cd link_abs % pwd /tmp/test/link_abs % cd .. % pwd ;# ok we are in /tmp (/tmp/test would be also plausible) /tmp % exit bash> ln -sf /tmp/dir/ link_abs_trailing_slash bash> tclsh % cd link_abs_trailing_slash % pwd /tmp/test/link_abs_trailing_slash % cd .. ;# should cd to /tmp (or /tmp/test) % pwd ;# surprise: we stay in same effective directory /tmp/dir % exit bash> ln -sf /tmp/dir link_rel bash> tclsh % cd link_rel % pwd /tmp/test/link_rel % cd .. % pwd ;# ok, but should be normalized /tmp/test/.. % file normalize [pwd] /tmp % exit bash> ln -sf ../dir/ link_rel_trailing_slash bash> tclsh % cd link_rel_trailing_slash % pwd /tmp/test/link_rel_trailing_slash % cd .. % pwd ;# surprise /tmp/dir % exit bash> ln -sf ./link_abs link2link bash> tclsh % cd link2link % pwd /tmp/test/link2link % cd .. ;# now we are in /tmp/test (also ok) % pwd ;# but should be normalized /tmp/test/. % file normalize [pwd] /tmp % puts "$::tcl_patchLevel, $::tcl_platform(os) $::tcl_platform(osVersion)" 8.5.11, Linux 3.2.0-30-generic % exit ---------------------------------------------------------------------- >Comment By: Sebastian Nagel (wastl-nagel) Date: 2012-09-21 04:56 Message: Both 8.5.12 and 8.6b3 are affected as well ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2012-09-21 00:50 Message: Whatever is going on, it's a feature of the file system engine and not the [cd] command itself. I suspect that it depends on what normalization does, and I know that Don Porter has been doing work in that area relatively recently. Is it possible to retest with 8.5.12 or 8.6b3? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3570244&group_id=10894 |