aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PropSet.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/PropSet.cxx b/src/PropSet.cxx
index c563d2bed..26b6afa4b 100644
--- a/src/PropSet.cxx
+++ b/src/PropSet.cxx
@@ -1056,10 +1056,13 @@ const char *WordList::GetNearestWord(const char *wordStart, int searchLen, bool
* counted in the length.
*/
static unsigned int LengthWord(const char *word, char otherSeparator) {
- // Find a '('. If that fails go to the end of the string.
- const char *endWord = strchr(word, '(');
- if (!endWord && otherSeparator)
+ const char *endWord = 0;
+ // Find an otherSeparator
+ if (otherSeparator)
endWord = strchr(word, otherSeparator);
+ // Find a '('. If that fails go to the end of the string.
+ if (!endWord)
+ endWord = strchr(word, '(');
if (!endWord)
endWord = word + strlen(word);
// Last case always succeeds so endWord != 0