aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-08-31 18:28:02 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2010-08-31 18:28:02 +0000
commit2516f60da9073f3b04c0bbfc37d3aefffe11767e (patch)
treeb7ce61b652acc1b0401fed3804605f5b56543ff7 /src
parentccedc1c93371e3b3826bc2d83b77ab1a26d07dc6 (diff)
downloadgoogletest-2516f60da9073f3b04c0bbfc37d3aefffe11767e.tar.gz
googletest-2516f60da9073f3b04c0bbfc37d3aefffe11767e.tar.bz2
googletest-2516f60da9073f3b04c0bbfc37d3aefffe11767e.zip
Publishes GTEST_HAS_STREAM_REDIRECTION (by Vlad Losev); casts char to unsigned char before calling isspace() etc to avoid undefined behavior (by Zhanyong Wan); fixes the VC projects (by Fredrik Roubert).
Diffstat (limited to 'src')
-rw-r--r--src/gmock-internal-utils.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gmock-internal-utils.cc b/src/gmock-internal-utils.cc
index cc51836b..9debe187 100644
--- a/src/gmock-internal-utils.cc
+++ b/src/gmock-internal-utils.cc
@@ -57,14 +57,14 @@ string ConvertIdentifierNameToWords(const char* id_name) {
for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
// We don't care about the current locale as the input is
// guaranteed to be a valid C++ identifier name.
- const bool starts_new_word = isupper(*p) ||
- (!isalpha(prev_char) && islower(*p)) ||
- (!isdigit(prev_char) && isdigit(*p));
+ const bool starts_new_word = IsUpper(*p) ||
+ (!IsAlpha(prev_char) && IsLower(*p)) ||
+ (!IsDigit(prev_char) && IsDigit(*p));
- if (isalnum(*p)) {
+ if (IsAlNum(*p)) {
if (starts_new_word && result != "")
result += ' ';
- result += static_cast<char>(tolower(*p));
+ result += ToLower(*p);
}
}
return result;