summaryrefslogtreecommitdiff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2011-01-06 16:49:25 +0000
committerBart Schaefer <barts@users.sourceforge.net>2011-01-06 16:49:25 +0000
commit87d6527628583c355883cc997d54d337abae2a7a (patch)
treea453aa43faf4fe7d2f24d0fc60657200ad1defe3 /Src/utils.c
parentdd0ad1ac2310853e3d4963c5715de6a9c058479f (diff)
downloadzsh-87d6527628583c355883cc997d54d337abae2a7a.tar.gz
zsh-87d6527628583c355883cc997d54d337abae2a7a.zip
28578: fix handling of numeric escapes that expand to "%" in printf
format strings, so they are not treated as format introducers.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index a1cac2537..a4cd67812 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -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';