diff options
author | 2015-01-15 11:21:07 -0800 | |
---|---|---|
committer | 2015-01-15 11:21:07 -0800 | |
commit | d4eded2376706c67b680ad522e61cbe54d8214b0 (patch) | |
tree | b213eebdde9183a2b36c33d61a2ba6dcbcb81a27 /builtin.cpp | |
parent | 20974edc14f43822084bf584c3d19fe23e80247b (diff) |
Make octal/hex escapes in printf and echo output literal bytes
Fixes #1894
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.cpp b/builtin.cpp index 597f51c5..44f4e84e 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -1937,8 +1937,8 @@ static int builtin_echo(parser_t &parser, wchar_t **argv) unsigned char narrow_val = 0; if (builtin_echo_parse_numeric_sequence(str + j + 1, &consumed, &narrow_val)) { - /* Here consumed must have been set to something */ - wc = narrow_val; //is this OK for conversion? + /* Here consumed must have been set to something. The narrow_val is a literal byte that we want to output (#1894) */ + wc = ENCODE_DIRECT_BASE + narrow_val % 256; } else { |