1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-29 16:25:35 +01:00

36552 plus test: fix Nularg string in quotestring(QT_DOLLARS)

This commit is contained in:
Barton E. Schaefer 2015-09-17 21:44:14 -07:00
parent 9955bbdb9f
commit 18130bed7f
3 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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.

View file

@ -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}