aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/functions-string.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbuild2/functions-string.cxx b/libbuild2/functions-string.cxx
index eccc6c7..58c17d7 100644
--- a/libbuild2/functions-string.cxx
+++ b/libbuild2/functions-string.cxx
@@ -38,14 +38,14 @@ namespace build2
{
n -= sn; // Don't consider characters out of range.
- for (size_t p (n);; )
+ for (size_t p (n);; --p)
{
if ((ic
? icasecmp (ss, s.c_str () + p, sn)
: s.compare (p, sn, ss)) == 0)
return p;
- if (--p == 0)
+ if (p == 0)
break;
}
}