zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: globbing fix
@ 2006-04-25 12:55 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2006-04-25 12:55 UTC (permalink / raw)
  To: Zsh hackers list

There's a subtle bug in the code to support multibyte patterns.  If a
path includes a segment which is specially handled, so that it doesn't
exist in the directory but springs into existence when referenced, you
can't use it in a pattern.  I found this when looking at the ".snaphost"
directory of a Netapp file server, which contains backups of recent
versions of files.

Index: Src/pattern.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v
retrieving revision 1.31
diff -u -r1.31 pattern.c
--- Src/pattern.c	9 Apr 2006 21:55:10 -0000	1.31
+++ Src/pattern.c	25 Apr 2006 12:52:22 -0000
@@ -1137,7 +1137,7 @@
 	 * ..(#a1).. (i.e. the (#a1) has no effect), but if you're
 	 * going to write funny patterns, you get no sympathy from me.
 	 */
-	if (patglobflags) {
+	if (patglobflags & (0xFF|GF_LCMATCHUC|GF_IGNCASE)) {
 	    if (!(patflags & PAT_FILE))
 		flags &= ~P_PURESTR;
 	    else if (!(nptr[0] == '.' &&

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-25 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-25 12:55 PATCH: globbing fix Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).