From cfbcd2dbe0ddcb18d8011e20058d1081d33f697a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 4 Jan 2007 15:41:21 +0000 Subject: 23086: printf should handle octal escapes in the \0NNN form --- ChangeLog | 5 +++++ Src/zsh.h | 5 +++-- Test/B03print.ztst | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 600ef77da..1ae2b45c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-04 Peter Stephenson + + * 20386: Src/zsh.h, Test/B03print.ztst: printf should handle + octal escapes in the '\0NNN' form. + 2007-01-02 Clint Adams * 22817: Frank Terbeck: Completion/Debian/Command/_aptitude: diff --git a/Src/zsh.h b/Src/zsh.h index 89482e514..48f50e6a1 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1955,7 +1955,8 @@ enum { enum { /* * Handle octal where the first digit is non-zero e.g. \3, \33, \333 - * \0333 etc. is always handled. + * Otherwise \0333 etc. is handled, i.e. one of \0123 or \123 will + * work, but not both. */ GETKEY_OCTAL_ESC = (1 << 0), /* @@ -1990,7 +1991,7 @@ enum { /* echo builtin */ #define GETKEYS_ECHO (GETKEY_BACKSLASH_C) /* printf format string */ -#define GETKEYS_PRINTF (GETKEY_OCTAL_ESC|GETKEY_BACKSLASH_C) +#define GETKEYS_PRINTF (GETKEY_BACKSLASH_C) /* Full print without -e */ #define GETKEYS_PRINT (GETKEY_OCTAL_ESC|GETKEY_BACKSLASH_C|GETKEY_EMACS) /* bindkey */ diff --git a/Test/B03print.ztst b/Test/B03print.ztst index d6dea5a3d..e36e55caa 100644 --- a/Test/B03print.ztst +++ b/Test/B03print.ztst @@ -259,3 +259,7 @@ printf $'%\0' 1:explicit null after % in format specifier ?(eval):printf:1: %: invalid directive + + printf '%b\n' '\0123' +0:printf handles \0... octal escapes in replacement text +>S -- cgit 1.4.1