mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +00:00
Fix str2wcs for LANG=C
4f0ade7a73
broke the tests when LANG was
C, so the MB_CUR_MAX==1 path wasn't working.
Seemingly that cast is doing some work here?
Just revert that bit for now, since this path is unimportant
anyway (please, please, please, please use a unicode capable locale).
This commit is contained in:
parent
e8d725e051
commit
66475732af
1 changed files with 5 additions and 1 deletions
|
@ -315,7 +315,11 @@ static wcstring str2wcs_internal(const char *in, const size_t in_len) {
|
|||
|
||||
// In the unlikely event that MB_CUR_MAX is 1, then we are just going to append.
|
||||
if (MB_CUR_MAX == 1) {
|
||||
result.insert(result.end(), in, in + in_len);
|
||||
size_t in_pos = 0;
|
||||
while (in_pos < in_len) {
|
||||
result.push_back(static_cast<unsigned char>(in[in_pos]));
|
||||
in_pos++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue