mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Merge pull request #915 from GlitchMr/fix-printf
printf '\0' now works. Fixes #908.
This commit is contained in:
commit
4726221d18
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
esc_value = esc_value * 16 + hex_to_bin(*p);
|
||||||
if (esc_length == 0)
|
if (esc_length == 0)
|
||||||
this->fatal_error(_(L"missing hexadecimal number in escape"));
|
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))
|
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. */
|
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)
|
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);
|
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))
|
else if (*p && wcschr(L"\"\\abcefnrtv", *p))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue