about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-03-08 12:00:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-03-08 12:00:15 +0000
commit02677cbdd64ae9591380610e6e4d013d7b5c156b (patch)
tree85ed79d095715a8c3cddac5bd40f886b96a18ffd
parent2ace0ce4f2803367a3006384172136a54118614e (diff)
downloadzsh-02677cbdd64ae9591380610e6e4d013d7b5c156b.tar.gz
zsh-02677cbdd64ae9591380610e6e4d013d7b5c156b.tar.xz
zsh-02677cbdd64ae9591380610e6e4d013d7b5c156b.zip
19554: make nocaseglob more efficient on Cygwin
-rw-r--r--ChangeLog4
-rw-r--r--Src/pattern.c11
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b4efdf880..d47d8ceba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-03-08  Peter Stephenson  <pws@csr.com>
 
+	* 19554: Src/pattern.c: improve users/7121 by allowing
+	Cygwin not to use pattern matching if only the case-insensitive
+	flag is on.
+
 	* 19553: Index: Src/Zle/complist.c, Src/Zle/zle_hist.c,
 	Src/Zle/zle_keymap.c, Src/Zle/zle_main.c, Src/Zle/zle_misc.c,
 	Src/Zle/zle_move.c, Src/Zle/zle_tricky.c, Src/Zle/zle_vi.c:
diff --git a/Src/pattern.c b/Src/pattern.c
index 1f0a87561..264144382 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -344,7 +344,16 @@ patcompile(char *exp, int inflags, char **endexp)
 
     if (!(patflags & PAT_ANY)) {
 	/* Look for a really pure string, with no tokens at all. */
-	if (!patglobflags)
+	if (!patglobflags
+#ifdef __CYGWIN__
+	    /*
+	     * If the OS treats files case-insensitively and we
+	     * are looking at files, we don't need to use pattern
+	     * matching to find the file.
+	     */
+	    || (!(patglobflags & ~GF_IGNCASE) && (patflags & PAT_FILE))
+#endif
+	    )
 	    for (strp = exp; *strp &&
 		     (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp);
 		 strp++)