nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Scott Blachowicz
Subject: Re: [Nmh-workers] Question on compath() in sbr/path.c
Date: Sat, 29 Jan 2005 15:23:02 -0800

Jon Steinhart <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]