From dbdd862a1f919d7561f23ce3998f6351a602e718 Mon Sep 17 00:00:00 2001 From: dockes Date: Thu, 21 Jun 2007 11:14:45 +0000 Subject: [PATCH] beware of unsigneds diffs when comparing to 0 ! --- src/common/rclconfig.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index c1dc8289..06f67196 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.47 2007-06-19 08:36:23 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.48 2007-06-21 11:14:45 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -305,9 +305,10 @@ bool RclConfig::inStopSuffixes(const string& fni) } } - string fn(fni, - MAX(0, fni.length() - m_maxsufflen), - MIN(fni.length(), m_maxsufflen)); + // Only need a tail as long as the longest suffix. + int pos = MAX(0, int(fni.length() - m_maxsufflen)); + string fn(fni, pos); + stringtolower(fn); SuffixStore::const_iterator it = STOPSUFFIXES->find(fn); if (it != STOPSUFFIXES->end()) {