From 02677cbdd64ae9591380610e6e4d013d7b5c156b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 8 Mar 2004 12:00:15 +0000 Subject: 19554: make nocaseglob more efficient on Cygwin --- ChangeLog | 4 ++++ Src/pattern.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b4efdf880..d47d8ceba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-03-08 Peter Stephenson + * 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++) -- cgit 1.4.1