diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-12-15 15:47:45 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-12-15 18:12:11 -0700 |
commit | 8ee95f35f2ed9766954281091a34cc5ca5b6fef8 (patch) | |
tree | 2ce386c8f806a9d2558a468c6122fe929a49e4ff /src/utils | |
parent | 90bc334b345f20860c79b6888f15106c7875d104 (diff) | |
download | manaserv-8ee95f35f2ed9766954281091a34cc5ca5b6fef8.tar.gz manaserv-8ee95f35f2ed9766954281091a34cc5ca5b6fef8.tar.xz manaserv-8ee95f35f2ed9766954281091a34cc5ca5b6fef8.zip |
Fix compareStrI function
It now takes length into consideration.
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/string.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/utils/string.cpp b/src/utils/string.cpp index 089a537..b74b91e 100644 --- a/src/utils/string.cpp +++ b/src/utils/string.cpp @@ -76,7 +76,13 @@ int compareStrI(const std::string &a, const std::string &b) return comp; } - return 0; + // See which one is longer, if either + if (itA == endA && itB != endB) + return -1; + else if (itA != endA && itB == endB) + return 1; + else + return 0; } bool stringToBool(const std::string &s, bool defaultValue) |