about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Src/pattern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index bfc9102a5..975ecc888 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -601,8 +601,8 @@ patcompbranch(int *flagp)
     *flagp = P_PURESTR;
 
     starter = chain = 0;
-    while (!memchr(patendseg, *patparse, patendseglen) &&
-	   (*patparse != Tilde ||
+    while (!memchr(patendseg, *patparse, patendseglen) ||
+	   (*patparse == Tilde &&
 	    memchr(patendseg, patparse[1], patendseglen))) {
 	if (isset(EXTENDEDGLOB) &&
 	    ((!isset(SHGLOB) &&