* Warner Losh <[EMAIL PROTECTED]> [010113 19:55] wrote:
> In message <[EMAIL PROTECTED]> "W.H.Scholten" writes:
> : +   while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
> 
> Style(9) says write this like:
>       while (path[ strlen(path)-1 ] == '/')
>               path[ strlen(path)-1 ] = 0;
> 
> : +
> : +   slash = strrchr(path, '/');
> : +   if (slash) {
> : +           *slash = 0;
> 
> this is not an integer, but rather a character.  *slash = '\0'; please.
> 
> : +           while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
> 
> Ditto.
> 
> 
> But why do this at all?
> 
> 'mkdir /a/b/////d/e' is required by posix to create /a/b/d/e if /a/b/d
> exists.

This isn't the point, if you do this:

mkdir /someplacethatdoesntexist/foo

you'll get:

mkdir: /someplacethatdoesntexist/foo: No such file or directory

What the patch does is make the error output say:

mkdir: /someplacethatdoesntexist: No such file or directory

Which makes a bit more sense than telling you it failed because
the thing that you know doesn't exist, doesn't exist. :)

You missed my latest email on it, basically I can just call
dirname(3) on the path depending on the errno to give a more
reasonable error message.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to