Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 26 Mar 2004 15:03:15 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Cc: "Pierre A. Humblet" <pierre.humblet@ieee.org>
Subject: Re: lstat on FAT - Was: Problem with find on FAT drives
Message-ID: <20040326200315.GA6997@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com, "Pierre A. Humblet" <pierre.humblet@ieee.org>
References: <Pine.LNX.4.44.0403231316380.32093-100000@ashi.FootPrints.net> <4060B627.8000400@scytek.de> <20040324155332.GF17229@cygbert.vinschen.de> <4061E702.1040705@scytek.de> <20040324205644.GA4580@redhat.com> <20040324213057.GA296803@Worldnet> <20040324214239.GA6079@redhat.com> <20040325023929.GA335381@hpn5170x>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20040325023929.GA335381@hpn5170x>
User-Agent: Mutt/1.4.1i

[just to provide a non-flip answer to this subject]
On Wed, Mar 24, 2004 at 09:39:29PM -0500, Pierre A. Humblet wrote:
>On Wed, Mar 24, 2004 at 04:42:39PM -0500, Christopher Faylor wrote:
>As you know isdirsep would take 1 extra compare per character.
>
>FWIW I see one place where we could avoid the kind of loop that Volker had.
>
>I wonder if 
>      char *p = strrchr (src, '\0');
>      /* Detect if the user was looking for a directory.  We have to strip the
>should be inside the symlink loop or outside. I guess that depends if
>symlink contents ending with / are special (on Sun the final / is stripped in
>symlinks, dunno about other Unix flavors).

I really hated putting that in there to begin with (and it should be a
'strchr' anyway) but it was required because Windows allows you to say
/foo/bar/ and even /foo/bar/. even when bar isn't a directory.  I don't
believe that the code would work right if that wasn't there.  It would
allow a symlink to /foo/bar/. to work when it shouldn't.

>Also normalize_posix_path strips the final /, except when it calls 
>normalize_win32_path. That makes the code go through extra hoops
>when resolving c:/the/symlink/, it looks for c:/the/symlink/.lnk

I suppose that should be fixed.

cgf

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

