projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c435eab
)
Revert "Extend minetest.is_yes()"
author
sfan5
<sfan5@live.de>
Sat, 7 Jan 2017 10:05:05 +0000
(11:05 +0100)
committer
sfan5
<sfan5@live.de>
Sat, 7 Jan 2017 10:05:05 +0000
(11:05 +0100)
This reverts commit
c435eabf3ffb77eab955d5faeb5450da1befc149
.
src/unittest/test_utilities.cpp
patch
|
blob
|
history
src/util/string.h
patch
|
blob
|
history
diff --git
a/src/unittest/test_utilities.cpp
b/src/unittest/test_utilities.cpp
index 58412dd85cb8dde84c7f0c13fbcd2eda0a83cf9f..d73975b9f84f11076932388f9a7372bc3e6ea4e6 100644
(file)
--- a/
src/unittest/test_utilities.cpp
+++ b/
src/unittest/test_utilities.cpp
@@
-147,8
+147,6
@@
void TestUtilities::testIsYes()
UASSERT(is_yes("0") == false);
UASSERT(is_yes("1") == true);
UASSERT(is_yes("2") == true);
- UASSERT(is_yes("on") == true);
- UASSERT(is_yes("off") == false);
}
diff --git
a/src/util/string.h
b/src/util/string.h
index ba3c09e513c2c18629e3b438cfc384d6dc6f5ae2..572c371502c5965167c764d3110cd72488034b2d 100644
(file)
--- a/
src/util/string.h
+++ b/
src/util/string.h
@@
-272,7
+272,7
@@
inline bool is_yes(const std::string &str)
{
std::string s2 = lowercase(trim(str));
- return s2 == "y" || s2 == "yes" || s2 == "true" ||
s2 == "on" ||
atoi(s2.c_str()) != 0;
+ return s2 == "y" || s2 == "yes" || s2 == "true" || atoi(s2.c_str()) != 0;
}