delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/24/20:22:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 24 Mar 2004 20:21:53 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: lstat on FAT - Was: Problem with find on FAT drives
Message-ID: <20040325012153.GA4436@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0403231316380 DOT 32093-100000 AT ashi DOT FootPrints DOT net> <4060B627 DOT 8000400 AT scytek DOT de> <20040324155332 DOT GF17229 AT cygbert DOT vinschen DOT de> <4061E702 DOT 1040705 AT scytek DOT de> <20040324205644 DOT GA4580 AT redhat DOT com> <20040324213057 DOT GA296803 AT Worldnet> <20040324214239 DOT GA6079 AT redhat DOT com> <406215C5 DOT 4040803 AT scytek DOT de>
Mime-Version: 1.0
In-Reply-To: <406215C5.4040803@scytek.de>
User-Agent: Mutt/1.4.1i

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 AT sourceware DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019