about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-07-19 14:26:14 +0000
commitd6d4a3abfc84f0940e663cd69537789a039a7056 (patch)
tree5f5f40ae248c17c34fccbcadef85dddd4136b781 /Src/glob.c
parent1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1 (diff)
downloadzsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.gz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.tar.xz
zsh-d6d4a3abfc84f0940e663cd69537789a039a7056.zip
zsh-3.1.6-test-2 zsh-3.1.6-test-2
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Src/glob.c b/Src/glob.c
index ea4980b8b..cf22ef923 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2724,6 +2724,9 @@ charmatch(Comp c, char *x, char *y)
      * Here we bypass tulower() and tuupper() for speed.
      */
     int xi = (STOUC(UNMETA(x)) & 0xff), yi = (STOUC(UNMETA(y)) & 0xff);
+    /* A NULL is a real null, since a \000 would be metafied. */
+    if (!*x || !*y)
+	return 0;
     return xi == yi ||
 	(((c->stat & C_IGNCASE) ?
 	  ((isupper(xi) ? tolower(xi) : xi) ==
@@ -2926,7 +2929,10 @@ rangematch(char **patptr, int ch, int rchar)
      * and optional ^ have already been skipped.          */
 
     char *pat = *patptr;
-#ifdef HAVE_STRCOLL
+    /* We don't use strcoll() for ranges, since it can have side
+     * effects.  It's less necessary now we have [:posix:] ranges.
+     */
+#if 0
     char l_buf[2], r_buf[2], ch_buf[2];
 
     ch_buf[0] = ch;
@@ -2944,7 +2950,7 @@ rangematch(char **patptr, int ch, int rchar)
 		break;
 	} else if (*pat == '-' && pat[-1] != rchar &&
 		   pat[1] != Outbrack) {
-#ifdef HAVE_STRCOLL
+#if 0
 	    l_buf[0] = PPAT(-1);
 	    r_buf[0] = PAT(1);
 	    if (strcoll(l_buf, ch_buf) <= 0 &&