diff --git a/src/common/strutil.h b/src/common/strutil.h index 1bc77ecae..b8174b3fe 100644 --- a/src/common/strutil.h +++ b/src/common/strutil.h @@ -7,6 +7,12 @@ #include "common/wcwidth.h" +#ifdef _WIN32 +// #include +__stdcall char* StrStrIA(const char* lpFirst, const char* lpSrch); + #define strcasestr StrStrIA +#endif + static inline bool ffStrSet(const char* str) { if (str == NULL) { return false; diff --git a/tests/strutil.c b/tests/strutil.c index a225c5ff9..ed3ddae03 100644 --- a/tests/strutil.c +++ b/tests/strutil.c @@ -110,7 +110,7 @@ int main(void) { uint8_t width = 0; uint8_t bytes = ffUtf8CharLenWidth(emoji, 4, &width); VERIFY(bytes == 4); - VERIFY(width == 2); // Most emoji are double-width + VERIFY(width == mk_wcwidth(0x1F600)); } puts("\033[32mAll tests passed!" FASTFETCH_TEXT_MODIFIER_RESET);