diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2011-01-06 16:49:25 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2011-01-06 16:49:25 +0000 |
commit | 87d6527628583c355883cc997d54d337abae2a7a (patch) | |
tree | a453aa43faf4fe7d2f24d0fc60657200ad1defe3 /Src/zsh.h | |
parent | dd0ad1ac2310853e3d4963c5715de6a9c058479f (diff) | |
download | zsh-87d6527628583c355883cc997d54d337abae2a7a.tar.gz zsh-87d6527628583c355883cc997d54d337abae2a7a.tar.xz 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/zsh.h')
-rw-r--r-- | Src/zsh.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Src/zsh.h b/Src/zsh.h index 6dc918c09..6d8ac0353 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -2492,7 +2492,11 @@ enum { * Yes, I know that doesn't seem to make much sense. * It's for use in completion, comprenez? */ - GETKEY_UPDATE_OFFSET = (1 << 7) + GETKEY_UPDATE_OFFSET = (1 << 7), + /* + * When replacing numeric escapes for printf format strings, % -> %% + */ + GETKEY_PRINTF_PERCENT = (1 << 8) }; /* @@ -2501,8 +2505,9 @@ enum { */ /* echo builtin */ #define GETKEYS_ECHO (GETKEY_BACKSLASH_C) -/* printf format string: \123 -> S, \0123 -> NL 3 */ -#define GETKEYS_PRINTF_FMT (GETKEY_OCTAL_ESC|GETKEY_BACKSLASH_C) +/* printf format string: \123 -> S, \0123 -> NL 3, \045 -> %% */ +#define GETKEYS_PRINTF_FMT \ + (GETKEY_OCTAL_ESC|GETKEY_BACKSLASH_C|GETKEY_PRINTF_PERCENT) /* printf argument: \123 -> \123, \0123 -> S */ #define GETKEYS_PRINTF_ARG (GETKEY_BACKSLASH_C) /* Full print without -e */ |