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