aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-15 11:21:07 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-01-15 11:21:07 -0800
commitd4eded2376706c67b680ad522e61cbe54d8214b0 (patch)
treeb213eebdde9183a2b36c33d61a2ba6dcbcb81a27 /builtin.cpp
parent20974edc14f43822084bf584c3d19fe23e80247b (diff)
Make octal/hex escapes in printf and echo output literal bytes
Fixes #1894
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp4
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
{