Bug 1141032: Fix a string comparison when checking for env overriding JIT defaults; r=h4writer

This commit is contained in:
Benjamin Bouvier 2015-03-06 19:35:46 +01:00
parent 039b8750e7
commit c3f7d8c441

View File

@ -43,14 +43,10 @@ T overrideDefault(const char *param, T dflt) {
if (!str)
return dflt;
if (IsBool<T>::value) {
if (strcmp(str, "true") == 0 ||
strcmp(str, "yes")) {
if (strcmp(str, "true") == 0 || strcmp(str, "yes") == 0)
return true;
}
if (strcmp(str, "false") == 0 ||
strcmp(str, "no")) {
if (strcmp(str, "false") == 0 || strcmp(str, "no") == 0)
return false;
}
Warn(param, str);
} else {
Maybe<int> value = ParseInt(str);