From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id FAA23769 for ; Tue, 11 Jun 1996 05:39:06 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA29669; Mon, 10 Jun 1996 15:27:47 -0400 (EDT) Resent-Date: Mon, 10 Jun 1996 15:27:47 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199606101928.VAA07303@bolyai.cs.elte.hu> Subject: Re: Globbing bug? To: hniksic@srce.hr (Hrvoje Niksic) Date: Mon, 10 Jun 1996 21:28:43 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: from Hrvoje Niksic at "Jun 7, 96 08:21:17 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: 7bit Resent-Message-ID: <"fSnKJ3.0.VF7.oS7ln"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1319 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- > I have found the following problem with globbing of symlinks pointing > to a directory: > Script started on Fri Jun 07 20:15:00 1996 > jagor% ls -l > total 4 > lrwxrwxrwx 1 hniksic f2 1 Jun 7 20:14 somefile -> / > -rw-r--r-- 1 hniksic f2 43 Jun 7 20:15 typescript > jagor% cd s*e/ > cd: no such file or directory: s*e/ > jagor% cd s*e > jagor% /bin/pwd > / > > That is, when symlink points to a directory, it will not be globbed if > it has a trailing /. OK. The patch below fixes this. Now pattern/ is equivalent to pattern(-/) instead of pattenr(/). This only affects leading dots in a filename glob pattern. > This is especially annoying when writing > something like: > jagor% cd site-lisp/g*a/lisp > and it fails (although g*a completes uniquely by itself in site-lisp > directory), because gnus-beta is a symbolic link to gnus-5.2.10. This is completely unrelated to the previous problem and it should not fail. For me this works so if it fails for you, please tell me more about it. Zoltan *** Src/glob.c 1996/06/07 15:14:45 2.18 --- Src/glob.c 1996/06/10 18:42:09 *************** *** 498,510 **** } } else if ((str[sl - 1] == '/') && !((str[sl - 2] == Star) && ! (str[sl - 3] == Star))) { /* foo/ == foo(/) */ /* No explicit qualifiers, but implicitly match final directory */ str[sl - 1] = '\0'; quals = (struct qual *)hcalloc(sizeof *quals); quals->func = qualmode; quals->data = S_IFDIR; ! quals->sense = 0; qualct = 1; } if (*str == '/') { /* pattern has absolute path */ --- 498,510 ---- } } else if ((str[sl - 1] == '/') && !((str[sl - 2] == Star) && ! (str[sl - 3] == Star))) { /* foo/ == foo(-/) */ /* No explicit qualifiers, but implicitly match final directory */ str[sl - 1] = '\0'; quals = (struct qual *)hcalloc(sizeof *quals); quals->func = qualmode; quals->data = S_IFDIR; ! quals->sense = 2; qualct = 1; } if (*str == '/') { /* pattern has absolute path */ -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBMbx3ZgupSCiLN749AQEl+gP/RAfBGESEjqg0twk/wS+2TpjpDcsqSEQ9 PSoRgKXI3LmogebSRXI7fmqcKLx2fSEpi3FZIIfk41qTEV5bk++79speuGb1ilk+ +1OAbtYrH5qLXovyXuvDSRnOlW6nJGec73iBEDjZDrmnyQphxoNJpZGgnKzo+uxp YWmaM9VTZY0= =7xdw -----END PGP SIGNATURE-----