39678: metafication of printf %q argument and result

This commit is contained in:
Peter Stephenson 2016-10-19 10:39:58 +01:00
parent 5b192a4cd1
commit 7e7e2d7e63
3 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2016-10-19 Peter Stephenson <p.stephenson@samsung.com>
* 39678: Src/builtin.c, Test/D07multibyte.ztst: printf %q
argument needs metafying and result unmetafying.
2016-10-18 m0viefreak <m0viefreak.cm@googlemail.com>
* 39590: Src/Zle/compresult.c: zle: Call zle-line-pre-redraw

View file

@ -4874,9 +4874,10 @@ bin_print(char *name, char **args, Options ops, int func)
break;
case 'q':
stringval = curarg ?
quotestring(curarg, QT_BACKSLASH_SHOWNULL) : &nullstr;
quotestring(metafy(curarg, curlen, META_USEHEAP),
QT_BACKSLASH_SHOWNULL) : &nullstr;
*d = 's';
print_val(stringval);
print_val(unmetafy(stringval, &curlen));
break;
case 'd':
case 'i':

View file

@ -579,3 +579,7 @@
0:Sorting of metafied Polish characters
>a ą b c ć d e ę f
>a ą b c ć d e ę f
printf '%q%q\n' 你你
0:printf %q and quotestring and general metafy / token madness
>你你