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:
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue