Subject: Re: CVS commit: src/usr.bin/find
To: None <source-changes@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: source-changes
Date: 10/22/2005 19:08:32
In article <20051022071528.GA698@antioche.eu.org>,
Manuel Bouyer <bouyer@antioche.eu.org> wrote:
>>
>> That particular one is easy to fix; they appear to do something like:
>>
>> if (path ends with a slash)
>> printf("%s%s\n", path, rest);
>> else
>> printf("%s/%s\n", path, rest);
>>
>> But that is a special case, it is not path normalization which they don't do.
>> They are not really trimming trailing slashes or anything. We can do the same
>> too.
>
>In this example, if /usr/share is a symlink pointing to some other directory,
>find /usr/share/ will follow it, while find /usr/share will not:
>baladeur# cd /tmp/
>baladeur# ln -s /usr/share .
>baladeur# find /tmp/share -name Berlin
>baladeur# find /tmp/share/ -name Berlin
>/tmp/share//zoneinfo/Europe/Berlin
>
>Stripping the trailing slash in find may cause a change in behavior in this
>case, but I don't know if it's a real problem or not (find /tmp/share/. would
>still work ok).
I am not stripping any trailing slash, I am just not printing an extra one
if one exists.
christos