Fix stmtch() for exact match after multiple partial matches

Keep looking for exact match after finding the second partial match.
This commit is contained in:
Markus Armbruster 2008-03-09 13:45:29 +01:00
parent 3c39479333
commit c2a687e357

View file

@ -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;
if (res == M_NOTFOUND)
res = i;
else
res = M_NOTUNIQUE;
break;
case ME_EXACT:
return i;