mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Outputter_t: Handle C locale like everything else
This tried to skip conversion if the locale had MB_CUR_MAX == 1, but in doing so it just entered an infinite recursion (because writestr(wchar_t*) called writestr(wchar_t*)). Instead, just let wcstombs handle it. Fixes #5724.
This commit is contained in:
parent
91e70e38e7
commit
2b0b3d3193
1 changed files with 0 additions and 6 deletions
|
@ -395,12 +395,6 @@ int outputter_t::writech(wint_t ch) {
|
||||||
void outputter_t::writestr(const wchar_t *str) {
|
void outputter_t::writestr(const wchar_t *str) {
|
||||||
assert(str && "Empty input string");
|
assert(str && "Empty input string");
|
||||||
|
|
||||||
if (MB_CUR_MAX == 1) {
|
|
||||||
// Single-byte locale (C/POSIX/ISO-8859).
|
|
||||||
this->writestr(str);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t len = wcstombs(0, str, 0); // figure amount of space needed
|
size_t len = wcstombs(0, str, 0); // figure amount of space needed
|
||||||
if (len == (size_t)-1) {
|
if (len == (size_t)-1) {
|
||||||
debug(1, L"Tried to print invalid wide character string");
|
debug(1, L"Tried to print invalid wide character string");
|
||||||
|
|
Loading…
Reference in a new issue