about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Src/pattern.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index e5c0a0cb3..63551967f 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -338,11 +338,12 @@ patcompile(char *exp, int inflags, char **endexp)
 
     if (!(patflags & PAT_ANY)) {
 	/* Look for a really pure string, with no tokens at all. */
-	for (strp = exp; *strp &&
-		 (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp);
-	     strp++)
-	    ;
-	if (*strp && *strp != '/') {
+	if (!patglobflags)
+	    for (strp = exp; *strp &&
+		     (!(patflags & PAT_FILE) || *strp != '/') && !itok(*strp);
+		 strp++)
+		;
+	if (!strp || (*strp && *strp != '/')) {
 	    /* No, do normal compilation. */
 	    strp = NULL;
 	    if (patcompswitch(0, &flags) == 0)