about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-05-01 19:43:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-05-01 19:43:44 +0000
commitcd1b5d86e0a6ac37e982c6a3b8725fd11076f14c (patch)
treee6e20319c704a612317e9459549315f77195a73c /Src
parent8da652f6ae53990288690abc96f438f561f5af4c (diff)
downloadzsh-cd1b5d86e0a6ac37e982c6a3b8725fd11076f14c.tar.gz
zsh-cd1b5d86e0a6ac37e982c6a3b8725fd11076f14c.tar.xz
zsh-cd1b5d86e0a6ac37e982c6a3b8725fd11076f14c.zip
users/17046: don't count too many elements when splitting quoted parameter
substitution on null parameter
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index fb65ba815..9603389cc 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3114,7 +3114,7 @@ wordcount(char *s, char *sep, int mul)
 	r = 1;
 	sl = strlen(sep);
 	for (; (c = findsep(&s, sep, 0)) >= 0; s += sl)
-	    if ((c && *(s + sl)) || mul)
+	    if ((c || mul) && (sl || *(s + sl)))
 		r++;
     } else {
 	char *t = s;