From 18130bed7fa032513261d426b8c3915cf11e20c1 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 17 Sep 2015 21:44:14 -0700 Subject: 36552 plus test: fix Nularg string in quotestring(QT_DOLLARS) --- ChangeLog | 6 ++++++ Src/utils.c | 6 ++++++ Test/D04parameter.ztst | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index d1143449a..6e02eae27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-09-17 Barton E. Schaefer + + * unposted: Test/D04parameter.ztst: test for 36552 + + * 36552: Src/utils.c: fix Nularg string in quotestring(QT_DOLLARS) + 2015-09-14 Daniel Shahaf * 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 @@ -5384,6 +5384,12 @@ quotestring(const char *s, char **e, int instring) "BUG: bad quote type in quotestring"); 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} -- cgit 1.4.1