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:
Fabian Homborg 2020-09-20 15:05:49 +02:00
parent e8d725e051
commit 66475732af

View file

@ -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;
}