mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-23 01:31:27 +01:00
28578: fix handling of numeric escapes that expand to "%" in printf
format strings, so they are not treated as format introducers.
This commit is contained in:
parent
dd0ad1ac23
commit
87d6527628
4 changed files with 19 additions and 8 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* utils.c - miscellaneous utilities
|
||||
*
|
||||
|
|
@ -5523,6 +5522,8 @@ getkeystring(char *s, int *len, int how, int *misc)
|
|||
}
|
||||
*t++ = zstrtol(s + (*s == 'x'), &s,
|
||||
(*s == 'x') ? 16 : 8);
|
||||
if ((how & GETKEY_PRINTF_PERCENT) && t[-1] == '%')
|
||||
*t++ = '%';
|
||||
if (svchar) {
|
||||
u[3] = svchar;
|
||||
svchar = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue