From c2a687e357749e88b6cf42236938584b07a6f3f4 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 9 Mar 2008 13:45:29 +0100 Subject: [PATCH] Fix stmtch() for exact match after multiple partial matches Keep looking for exact match after finding the second partial match. --- src/lib/common/stmtch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/common/stmtch.c b/src/lib/common/stmtch.c index 0f018713..b2343292 100644 --- a/src/lib/common/stmtch.c +++ b/src/lib/common/stmtch.c @@ -56,9 +56,10 @@ stmtch(char *needle, void *haystack, ptrdiff_t offs, size_t elt_size) case ME_MISMATCH: break; case ME_PARTIAL: - if (res >= 0) - return M_NOTUNIQUE; - res = i; + if (res == M_NOTFOUND) + res = i; + else + res = M_NOTUNIQUE; break; case ME_EXACT: return i;