Commit e9adbcbb by vladlosev

Simplifies ASCII character detection in gtest-printers.h. This also makes it…

Simplifies ASCII character detection in gtest-printers.h. This also makes it possible to build Google Test on MinGW.
parent 6323646e
...@@ -288,8 +288,7 @@ static void PrintWideCharsAsStringTo(const wchar_t* begin, size_t len, ...@@ -288,8 +288,7 @@ static void PrintWideCharsAsStringTo(const wchar_t* begin, size_t len,
bool is_previous_hex = false; bool is_previous_hex = false;
for (size_t index = 0; index < len; ++index) { for (size_t index = 0; index < len; ++index) {
const wchar_t cur = begin[index]; const wchar_t cur = begin[index];
if (is_previous_hex && 0 <= cur && cur < 128 && if (is_previous_hex && isascii(cur) && IsXDigit(static_cast<char>(cur))) {
IsXDigit(static_cast<char>(cur))) {
// Previous character is of '\x..' form and this character can be // Previous character is of '\x..' form and this character can be
// interpreted as another hexadecimal digit in its number. Break string to // interpreted as another hexadecimal digit in its number. Break string to
// disambiguate. // disambiguate.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment