This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: detect . in a/.//


On Wed, Sep 30, 2009 at 01:04:04PM -0600, Eric Blake wrote:
>According to Christopher Faylor on 9/30/2009 9:34 AM:
>>> Is this function supposed to detect just "." or "*/."?
>
>Both.
>
>>   /* SUSv3: . and .. are not allowed as last components in various system
>>      calls.  Don't test for backslash path separator since that's a Win32
>>      path following Win32 rules. */
>>   const char *last_comp = strrchr (dir, '\0');
>
>Looked like a decent rewrite to me, except why did you use strrchr instead
>of strchr to find the end of the string?

Oops.  That was an oversight.  I'll change it to strchr and check it in.
Thanks for catching that.

Btw, I've only confirmed that this compiles.  I haven't actually tested it.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]