about summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-04-26 09:51:27 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-04-26 09:51:27 +0000
commitba1a54551601f996c9fa6a44c6bd6b8b0f5ca53a (patch)
treed99b621286b51178db80de5bd5220738f428f5f1 /Src/pattern.c
parentce49d62d45278b2fe559b180ba6ef870215b2037 (diff)
downloadzsh-ba1a54551601f996c9fa6a44c6bd6b8b0f5ca53a.tar.gz
zsh-ba1a54551601f996c9fa6a44c6bd6b8b0f5ca53a.tar.xz
zsh-ba1a54551601f996c9fa6a44c6bd6b8b0f5ca53a.zip
21194: fix handling of zero-length quoted test strings for patterns
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index 1033c776f..ed88bb7ce 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -1552,8 +1552,10 @@ pattryrefs(Patprog prog, char *string, int stringlen, int unmetalen,
 	*nump = 0;
     }
     /* inherited from domatch, but why, exactly? */
-    if (*string == Nularg)
+    if (*string == Nularg) {
 	string++;
+	unmetalen--;
+    }
 
     if (stringlen < 0)
 	stringlen = strlen(string);