nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Question on compath() in sbr/path.c

2005-01-29 16:46:22
Jon Steinhart <jon(_at_)fourwinds(_dot_)com> wrote:

One of the tests (second one under case '.') looks for a trailing /.. on a
path.  It would convert a path of /foo/bar/.. to /foo.

This doesn't seem correct to me. It works unless bar is a symbolic link.
A /.. after a symbolic link climbs up the tree on the link target side of
things, not the link name.

Depends on how you look at it.  You can argue that it's doing the "right
thing" from the user's point of view...the same way that some shells track how
you actually get to a directory and interpret ".." as being go up a dir level
along the path you took to get there.  That is, in those shells, you do this:

        % cd /foo/bar
        % pwd
        /foo/bar
        % /bin/pwd
        /files1/local-software/foo/linux/bar
        % cd ..
        % pwd
        /foo
        % /bin/pwd
        /files1/local-software/foo
        % ls -l /foo
        ....  foo -> /files1/local-software/foo
        % ls -l /foo/bar
        ....  bar -> linux/bar

if you get my drift (and I didn't make any typos :)).

So two questions: Should I fix it and what's the correct fix? If it
should be fixed, the only thing that I can see doing is to remove this
section of code because there's no requirement that the path passed to
compath() exists, making it impossible to test the path elements.

My guess is that it doesn't really need fixing...

Scott


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>