<i>"cd .." behaves wrong if last element in pwd is a symlink</i>.
by
.
D 2012-09-20T21:26:59
J assignee dkf
J cmimetype text/plain
J comment If\sthe\slast\selement\sof\sa\sthe\scurrent\spath\s(pwd)\sis\sa\ssymbolic\slink\swith\sa\strailing\sslash\sthe\scommand\n\s\scd\s..\ndoes\snot\schange\sinto\sthe\sparent\sdirectory\sbut\sstays\sin\sthe\scurrent\sdirectory.\n\nIn\saddition,\swhen\sthe\slink\starget\sis\sa\srelative\spath\scontaining\s".."\sor\s"."\sthe\spwd\safter\s"cd\s.."\smay\srequire\snormalization.\n\nRelated\s/\spossible\sduplicate\sof\s"cd\s..\sfrom\slink\sin\sWindows\sconfuses\sTcl\s-\sID:\s3183016"\n\n\nbash>\spwd\n/tmp/test\nbash>\smkdir\s/tmp/dir\nbash>\sln\s-sf\s/tmp/dir\slink_abs\nbash>\stclsh\n%\scd\slink_abs\n%\spwd\n/tmp/test/link_abs\n%\scd\s..\n%\spwd\s\s;#\sok\swe\sare\sin\s/tmp\s(/tmp/test\swould\sbe\salso\splausible)\n/tmp\n%\sexit\n\nbash>\sln\s-sf\s/tmp/dir/\slink_abs_trailing_slash\nbash>\stclsh\n%\scd\slink_abs_trailing_slash\n%\spwd\n/tmp/test/link_abs_trailing_slash\n%\scd\s..\s\s;#\sshould\scd\sto\s/tmp\s(or\s/tmp/test)\n%\spwd\s\s\s\s;#\ssurprise:\swe\sstay\sin\ssame\seffective\sdirectory\n/tmp/dir\n%\sexit\n\nbash>\sln\s-sf\s/tmp/dir\slink_rel\nbash>\stclsh\n%\scd\slink_rel\n%\spwd\n/tmp/test/link_rel\n%\scd\s..\n%\spwd\s\s\s\s;#\sok,\sbut\sshould\sbe\snormalized\n/tmp/test/..\n%\sfile\snormalize\s[pwd]\s\n/tmp\n%\sexit\n\nbash>\sln\s-sf\s../dir/\slink_rel_trailing_slash\nbash>\stclsh\n%\scd\slink_rel_trailing_slash\n%\spwd\n/tmp/test/link_rel_trailing_slash\n%\scd\s..\n%\spwd\s\s\s\s;#\ssurprise\n/tmp/dir\n%\sexit\n\nbash>\sln\s-sf\s./link_abs\slink2link\nbash>\stclsh\n%\scd\slink2link\n%\spwd\n/tmp/test/link2link\n%\scd\s..\s\s;#\snow\swe\sare\sin\s/tmp/test\s(also\sok)\n%\spwd\s\s\s\s;#\sbut\sshould\sbe\snormalized\n/tmp/test/.\n%\sfile\snormalize\s[pwd]\s\n/tmp\n\n%\sputs\s"$::tcl_patchLevel,\s$::tcl_platform(os)\s$::tcl_platform(osVersion)"\n8.5.11,\sLinux\s3.2.0-30-generic\n%\sexit\n
J foundin None
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter wastl-nagel
J subsystem 16.\sCommands\sA-H
J title "cd\s.."\sbehaves\swrong\sif\slast\selement\sin\spwd\sis\sa\ssymlink
J type Bug
K 3570244fffffffffffffffffffffffffffffffff
U wastl-nagel
Z a4fc52da6b362a9c0750cd4ed8223b79