… | |
… | |
2387 | } |
2387 | } |
2388 | |
2388 | |
2389 | if (len == (size_t)-1) |
2389 | if (len == (size_t)-1) |
2390 | { |
2390 | { |
2391 | mbstate.reset (); // reset now undefined conversion state |
2391 | mbstate.reset (); // reset now undefined conversion state |
2392 | // a -1 might indicate that a previous incomplet char is invalid (previous return -2) |
2392 | // a -1 might indicate that a previous incomplete char is invalid (previous return -2) |
2393 | // in which case we "errornously" return the next byte which might be valid. |
2393 | // in which case we "erroneously" return the next byte which might be valid. |
2394 | return (unsigned char)*cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through |
2394 | return (unsigned char)*cmdbuf_ptr++; // the _occasional_ latin1 character is allowed to slip through |
2395 | } |
2395 | } |
2396 | |
2396 | |
2397 | // assume wchar == unicode |
2397 | // assume wchar == unicode |
2398 | cmdbuf_ptr += len; |
2398 | cmdbuf_ptr += len; |