detect . in a/.//

Christopher Faylor
Wed Sep 30 19:31:00 GMT 2009

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 "*/."?
>>   /* 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.


More information about the Cygwin-patches mailing list