about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Doc/Zsh/options.yo10
-rw-r--r--Src/options.c1
-rw-r--r--Src/pattern.c5
-rw-r--r--Src/zsh.h1
5 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9050001e..416bcf91a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-06  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* zsh-users/7121: Doc/Zsh/options.yo, Src/options.c,
+	Src/pattern.c, Src/zsh.h: NO_CASE_GLOB option for
+	case-insensitive globbing.
+
 2004-03-05  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* unposted: config.guess, config.sub: update to versions from
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index c48427316..aa22b016f 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -219,6 +219,16 @@ Make the tt(echo) builtin compatible with the BSD manref(echo)(1) command.
 This disables backslashed escape sequences in echo strings unless the
 tt(-e) option is specified.
 )
+pindex(CASE_GLOB)
+cindex(case-insensitive globbing, option)
+item(tt(CASE_GLOB) <D>)(
+Make globbing (filename generation) sensitive to case.  Note that other
+uses of patterns are always sensitive to case.  If the option is unset,
+the presence of any character which is special to filename generation
+will cause case-insensitive matching.  For example, tt(cvs(/)) can
+match the directory tt(CVS) owing to the presence of the globbing flag
+(unless the option tt(BARE_GLOB_QUAL) is unset).
+)
 pindex(C_BASES)
 cindex(bases, output in C format)
 cindex(hexadecimal, output in C format)
diff --git a/Src/options.c b/Src/options.c
index 8cc8f2a8e..359229a57 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -92,6 +92,7 @@ static struct optname optns[] = {
 {NULL, "bgnice",	      OPT_EMULATE|OPT_NONBOURNE, BGNICE},
 {NULL, "braceccl",	      OPT_EMULATE,		 BRACECCL},
 {NULL, "bsdecho",	      OPT_EMULATE|OPT_SH,	 BSDECHO},
+{NULL, "caseglob",	      OPT_ALL,			 CASEGLOB},
 {NULL, "cbases",	      0,			 CBASES},
 {NULL, "cdablevars",	      OPT_EMULATE,		 CDABLEVARS},
 {NULL, "chasedots",	      OPT_EMULATE,		 CHASEDOTS},
diff --git a/Src/pattern.c b/Src/pattern.c
index b62cbcd37..1f0a87561 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -289,7 +289,10 @@ static long rn_offs;
 void
 patcompstart(void)
 {
-    patglobflags = 0;
+    if (isset(CASEGLOB))
+	patglobflags = 0;
+    else
+	patglobflags = GF_IGNCASE;
 }
 
 /* Top level pattern compilation subroutine */
diff --git a/Src/zsh.h b/Src/zsh.h
index cf470f001..aab4737f9 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1412,6 +1412,7 @@ enum {
     BGNICE,
     BRACECCL,
     BSDECHO,
+    CASEGLOB,
     CBASES,
     CDABLEVARS,
     CHASEDOTS,