summaryrefslogtreecommitdiff
path: root/Src/pattern.c
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 /Src/pattern.c
parent2ace0ce4f2803367a3006384172136a54118614e (diff)
downloadzsh-02677cbdd64ae9591380610e6e4d013d7b5c156b.tar.gz
zsh-02677cbdd64ae9591380610e6e4d013d7b5c156b.zip
19554: make nocaseglob more efficient on Cygwin
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c11
1 files changed, 10 insertions, 1 deletions
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++)