summaryrefslogtreecommitdiff
path: root/common/str.cpp
diff options
context:
space:
mode:
authorleo2003-07-30 17:23:39 +0000
committerleo2003-07-30 17:23:39 +0000
commit8019b524d8a17d313dec97f56845c3a40d4df291 (patch)
treec9189e6704d831eafcd853755e26f4dd202b0138 /common/str.cpp
parent30a0a3fa7fa13af938d41b9a4118dfbcc7273315 (diff)
Fixed a bug in String::CompareNoCase.
git-svn-id: http://svn.leocad.org/trunk@342 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/str.cpp')
-rw-r--r--common/str.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 304cd88..ee1b35c 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -198,7 +198,7 @@ int String::CompareNoCase(const char *string, int count) const
{
char c1, c2, *ch = m_pData;
- while (*ch && *string && count)
+ while (*ch && *string)
{
c1 = tolower (*ch);
c2 = tolower (*string);
@@ -209,6 +209,9 @@ int String::CompareNoCase(const char *string, int count) const
ch++;
string++;
count--;
+
+ if (!count)
+ return 0;
}
return (((int)*ch) - ((int)*string));