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:
parent
3c39479333
commit
c2a687e357
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue