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

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
Message-ID: <406215C5.4040803@scytek.de>
Date: Wed, 24 Mar 2004 18:12:05 -0500
From: Volker Quetschke <quetschke AT scytek DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: lstat on FAT - Was: Problem with find on FAT drives
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>
In-Reply-To: <20040324214239.GA6079@redhat.com>
X-Scanned-By: MIMEDefang 2.39
X-IsSubscribed: yes

>>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." At the moment this is
only done when the path either contains a drive letter or is an
unc path.

This is not done for "normal" DOS paths, IMHO consistency
would require that all remaining "\" are converted to "/" for all
paths. Isn't this what normalize_posix_path is meant to do?

I.e. put:

--- snip ---
for (char *p = dst; (p = strchr (p, '\\')); p++)
   *p = '/';
--- snap ---

in line 212 in path.cc before the remaing cases are evaluated.

Volker

-- 
PGP/GPG key  (ID: 0x9F8A785D)  available  from  wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D

--
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