about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-09-17 21:44:14 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-09-17 21:44:14 -0700
commit18130bed7fa032513261d426b8c3915cf11e20c1 (patch)
tree0ccb60829e871c2f8752b2931215f3b80c10cc1d
parent9955bbdb9faeac388abec68c6b5b976bce27df92 (diff)
downloadzsh-18130bed7fa032513261d426b8c3915cf11e20c1.tar.gz
zsh-18130bed7fa032513261d426b8c3915cf11e20c1.tar.xz
zsh-18130bed7fa032513261d426b8c3915cf11e20c1.zip
36552 plus test: fix Nularg string in quotestring(QT_DOLLARS)
-rw-r--r--ChangeLog6
-rw-r--r--Src/utils.c6
-rw-r--r--Test/D04parameter.ztst4
3 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d1143449a..6e02eae27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-17  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* unposted: Test/D04parameter.ztst: test for 36552
+
+	* 36552: Src/utils.c: fix Nularg string in quotestring(QT_DOLLARS)
+
 2015-09-14  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* unposted: Doc/Zsh/zle.yo README: docs: Typo fixes
diff --git a/Src/utils.c b/Src/utils.c
index ca68eae32..d5fd88c00 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -5385,6 +5385,12 @@ quotestring(const char *s, char **e, int instring)
     u = s;
     if (instring == QT_DOLLARS) {
 	/*
+	 * The only way to get Nularg here is when
+	 * it is placeholding for the empty string?
+	 */
+	if (inull(*u))
+	    *u++;
+	/*
 	 * As we test for printability here we need to be able
 	 * to look for multibyte characters.
 	 */
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index c7d506a51..e380e19b8 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -413,6 +413,10 @@
 >$'playing \'stupid\' "games" \\w\\i\\t\\h $quoting.'
 >'playing '\'stupid\'' "games" \w\i\t\h $quoting.'
 
+  print -r ${(qqqq):-""}
+0:workers/36551: literal empty string in ${(qqqq)...}
+>$''
+
   x=( a '' '\b' 'c d' '$e' )
   print -r ${(q)x}
   print -r ${(q-)x}