delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/03/06/08:07:16

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Tue, 6 Mar 2001 14:06:41 +0100
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: Some "interesting" changes checked in
Message-ID: <20010306140641.D7734@cygbert.vinschen.de>
Reply-To: Corinna Vinschen <cygwin-developers AT cygwin DOT com>
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <20010305013457 DOT A1344 AT redhat DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010305013457.A1344@redhat.com>; from cgf@redhat.com on Mon, Mar 05, 2001 at 01:34:58AM -0500

On Mon, Mar 05, 2001 at 01:34:58AM -0500, Christopher Faylor wrote:
> I've checked in some changes that may destabilize things for a while
> until the bugs have been wrung out.
> 
> 1) Changed CTRL-Z handling so that tty handler recognizes when a signal
>    has been sent and exits appropriately.
> 
> 2) Cleaned up extension scanning in symlink_info::check.  I've been slowly
>    cleaning up this routine and Corinna's addition of .lnk scanning prompted
>    me to work on this a little more.
> 
> 3) Eliminated the ReadFile (this topic was all the rage in the cygwin mailing
>    list a while ago) unless the program using cygwin needs to check for the
>    executable bit.  This requires a recompilation to operate correctly.
> 
> The one that is probably most iffy is 2.  I really redesigned things and
> everything seemed to work the first time.  That's usually a symptom that
> I got something horribly wrong somewhere and I just don't remember one
> of the parameters to the problem.  It does seem to scan .exe extensions
> correctly and correctly default to finding .lnk when appropriate,
> though.

Your patch has broken readdir's ability to drop the .lnk suffix.
The problem is that in symlink::check the call to suffix.lnk_match()
only sets sym_check to 1 when suffix.next() has added the .lnk suffix
by itself but not when it's already given in the input file name. This
results in a weird behaviour.

Example:

cd /
mkdir foo
cd ~
ln -s /foo
ls -l foo
	-> results in `lrwxrwxrwx ... foo -> /foo      <- OK
ls -l foo.lnk
	-> results in `lrwxrwxrwx ... foo.lnk -> /foo  <- OK
ls -l
	-> results in `lrwxrwxrwx ... foo.lnk -> /foo  <- Wrong
cd foo
	-> works                                       <- OK
cd ~
cd foo.lnk
	-> results in `foo.lnk: Not a directory.'      <- Wrong

The error is in suffix_scan::has. The order of the conditionals
disallows .lnk suffixes for input files when in_suffixes is NULL.

I have checked in a patch.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

- Raw text -


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