sheredom / utf8.h

📚 single header utf8 string functions for C and C++
The Unlicense
1.71k stars 122 forks source link

Fix for utf8str when the needle partially matches (foobar, oba) #54

Closed roxas232 closed 5 years ago

roxas232 commented 5 years ago

Without this fix, utf8str( "foobar", "oba" ) returned NULL.

sheredom commented 5 years ago

Hey there! Thanks for the commit - could you add a unit test case for the failure to please? That way I won't ever accidentally regress it again ;)

Test file is here https://github.com/sheredom/utf8.h/blob/master/test/main.c

roxas232 commented 5 years ago

Hi sheredom, I added two test cases and fixed utf8casestr as well. Hope that helps =)

sheredom commented 5 years ago

Yay thank you!

roxas232 commented 5 years ago

No problem!