aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-07-19 00:17:37 -0700
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-07-19 00:17:37 -0700
commit4726221d181fd71a94cdaba2328f1f5c911208e8 (patch)
tree2114c5d808592b5e940dbfeee8567e2d5726b9db
parent7353c6f94db0adfc37c0cca9882db41e252fd82d (diff)
parent91a04c7638bbfbe8abb59d17b2c6b8aeb7b04a05 (diff)
Merge pull request #915 from GlitchMr/fix-printf
printf '\0' now works. Fixes #908.
-rw-r--r--builtin_printf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin_printf.cpp b/builtin_printf.cpp
index 0e35b129..efe4a211 100644
--- a/builtin_printf.cpp
+++ b/builtin_printf.cpp
@@ -362,7 +362,7 @@ long builtin_printf_state_t::print_esc(const wchar_t *escstart, bool octal_0)
esc_value = esc_value * 16 + hex_to_bin(*p);
if (esc_length == 0)
this->fatal_error(_(L"missing hexadecimal number in escape"));
- this->append_format_output(L"%lc", esc_value);
+ this->append_output(esc_value);
}
else if (is_octal_digit(*p))
{
@@ -371,7 +371,7 @@ long builtin_printf_state_t::print_esc(const wchar_t *escstart, bool octal_0)
extension to POSIX that is compatible with Bash 2.05b. */
for (esc_length = 0, p += octal_0 && *p == L'0'; esc_length < 3 && is_octal_digit(*p); ++esc_length, ++p)
esc_value = esc_value * 8 + octal_to_bin(*p);
- this->append_format_output(L"%c", esc_value);
+ this->append_output(esc_value);
}
else if (*p && wcschr(L"\"\\abcefnrtv", *p))
{