This is the mail archive of the cygwin 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: lstat on FAT - Was: Problem with find on FAT drives


On Wed, Mar 24, 2004 at 06:12:05PM -0500, Volker Quetschke wrote:
>>>I also had a look at the code and reached pretty much the same conclusion
>>>as Volker. Replacing all 'isslash (*src)' and 'isslash (src[x])' in
>>>normalize_posix_path by "isdirsep ()" would yield more consistent results.
>>>I know this code is delicate but the possible drawback isn't obvious.
>>
>>speed disadvantage for nebulous gain.
>I will not comment on the nebulous gain, but it is not necessary
>at all to use sdirsep () or both '\' and '/' in normalize_posix_path.
>
>Just let the function do what its comment says, namely
>"\'s are converted to /'s in the process."

Easy enough to change the comment.  I've done that.

I've sent a patch to Corinna for comment which should have a minimal
performance hit on parsing posix paths but will a have slightly larger
effect if it backslashes are hit.

>I.e. put:
>
>--- snip ---
>for (char *p = dst; (p = strchr (p, '\\')); p++)
>  *p = '/';
>--- snap ---

So, check every character in the string to see if it's a backslash
then use another loop to iterate over the string to check for other
stuff.  No thanks.

As you note in your later message, this wouldn't work anyway.  dst
is "const" for a reason.
--
Christopher Faylor                spammer -> aaspama@sourceware.org
Cygwin Project Leader
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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