Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3E29412E.DD1EDF2D@phekda.freeserve.co.uk> Date: Sat, 18 Jan 2003 11:57:34 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: DJGPP workers Subject: Re: [Fwd: Bugs in __solve_symlinks] References: <3E270365 DOT 372459D1 AT phekda DOT freeserve DOT co DOT uk> <3E273A88 DOT 6050403 AT mif DOT vu DOT lt> <3E273F69 DOT F42991B2 AT phekda DOT freeserve DOT co DOT uk> <3E28677A DOT 7070804 AT mif DOT vu DOT lt> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Laurynas Biveinis wrote: > > > HERE=`pwd` > > ln -s /dev/env/FOO link > > export FOO=../../somefile > > echo Hello > $FOO > > cat link > > cd .. > > cat link Oops, obviously the last line should be: cat /link or: cat $HERE/link > > I don't think this will work, because the __solve_symlinks CVS code does > > not resolve /dev/env/* inline. It will get the filename from link and > > restart the resolution with /dev/env/FOO rather than `pwd`/$FOO. At least, > > that's how I think it will work. > > I have not looked if it *should* work, but I've tried it and it did :) I > guess it's because my code never goes back in path (just adds to it or > discards completely). Huh? I just backed out all the changes I made, did a CVS update and rebuilt fileutils, sh-utils and textutils, then tried this: bash-2.04$ cd /temp/ bash-2.04$ mkdir -p somewhere/over/the/rainbow bash-2.04$ cd somewhere/over/the/rainbow/ bash-2.04$ pwd c:/temp/somewhere/over/the/rainbow bash-2.04$ HERE=`pwd` bash-2.04$ ln -s /dev/env/FOO link bash-2.04$ export FOO=../../somefile bash-2.04$ echo Hello > $FOO bash-2.04$ ls -l $FOO -rw-r--r-- 1 rich root 7 Jan 18 11:55 ../../somefile bash-2.04$ cat link Hello bash-2.04$ cd .. bash-2.04$ cat rainbow/link c:/djgpp.204/bin/cat.exe: rainbow/link: No such file or directory (ENOENT) bash-2.04$ ls -l rainbow/link lrw-r--r-- 1 rich root 510 Jan 18 11:55 rainbow/link -> /dev/env/FOO bash-2.04$ cat $HERE/link c:/djgpp.204/bin/cat.exe: c:/temp/somewhere/over/the/rainbow/link: No such file or directory (ENOENT) bash-2.04$ ls -l $HERE/link lrw-r--r-- 1 rich root 510 Jan 18 11:55 c:/temp/somewhere/over/the/rainbow/link -> /dev/env/FOO ls -l shows the link "link" as satisfied, when I am in $HERE, but broken, when I am in "$HERE/..". Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]