about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-10-23 16:09:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-10-23 16:09:10 +0000
commit988be99034d4a475b98f308f02a1e9af831ef459 (patch)
tree7d95274f8ff8fab317ef60bbc1f8fffe568e2429 /Src
parent6567e77a4e474d9fcc90aeaf645598a79462f3c1 (diff)
downloadzsh-988be99034d4a475b98f308f02a1e9af831ef459.tar.gz
zsh-988be99034d4a475b98f308f02a1e9af831ef459.tar.xz
zsh-988be99034d4a475b98f308f02a1e9af831ef459.zip
users/12087: fix globbing problem on Cygwin
Diffstat (limited to 'Src')
-rw-r--r--Src/pattern.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 9e2df499c..26b06513e 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -1167,7 +1167,26 @@ patcomppiece(int *flagp)
 	 * ..(#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 & (0xFF|GF_LCMATCHUC|GF_IGNCASE)) {
+	if (patglobflags &
+#ifdef __CYGWIN__
+	    /*
+	     * As above: don't use pattern matching for files
+	     * just because of case insensitivity if file system
+	     * is known to be case insensitive.
+	     *
+	     * This is known to be necessary in at least one case:
+	     * if "mount -c /" is in effect, so that drives appear
+	     * directly under / instead of the usual /cygdrive, they
+	     * aren't shown by readdir().  So it's vital we don't use
+	     * globbing to find "/c", since that'll fail.
+	     */
+	    ((patflags & PAT_FILE) ?
+	    (0xFF|GF_LCMATCHUC) :
+	    (0xFF|GF_LCMATCHUC|GF_IGNCASE))
+#else
+	    (0xFF|GF_LCMATCHUC|GF_IGNCASE)
+#endif
+	    ) {
 	    if (!(patflags & PAT_FILE))
 		flags &= ~P_PURESTR;
 	    else if (!(nptr[0] == '.' &&