about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 35aa447de..93b497632 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -744,7 +744,7 @@ parsecomp(int gflag)
 		pptr++;
 	}
 
-	if (*pptr == Inpar && pptr[1] == Pound) {
+	if (*pptr == Inpar && pptr[1] == Pound && isset(EXTENDEDGLOB)) {
 	    /* Found some globbing flags */
 	    char *eptr = pptr;
 	    if (kshfunc != KF_NONE)
@@ -3432,17 +3432,17 @@ tokenize(char *s)
 void
 remnulargs(char *s)
 {
-    int nl = *s;
-    char *t = s;
-
-    while (*s)
-	if (INULL(*s))
-	    chuck(s);
-	else
-	    s++;
-    if (!*t && nl) {
-	t[0] = Nularg;
-	t[1] = '\0';
+    if (*s) {
+	char *t = s, *p = s, c;
+
+	while ((c = *s++))
+	    if (!INULL(c))
+		*p++ = c;
+	*p = '\0';
+	if (!*t) {
+	    t[0] = Nularg;
+	    t[1] = '\0';
+	}
     }
 }