1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

MSVC: xz: Use _stricmp() instead of strcasecmp() in suffix.c.

This commit is contained in:
Kelvin Lee 2023-09-05 15:05:09 +03:00 committed by Lasse Collin
parent e241051f50
commit 5c6f892d41

View file

@ -21,7 +21,13 @@
# ifdef HAVE_STRINGS_H # ifdef HAVE_STRINGS_H
# include <strings.h> # include <strings.h>
# endif # endif
# define strcmp strcasecmp # ifdef _MSC_VER
# define suffix_strcmp _stricmp
# else
# define suffix_strcmp strcasecmp
# endif
#else
# define suffix_strcmp strcmp
#endif #endif
@ -98,7 +104,7 @@ test_suffix(const char *suffix, const char *src_name, size_t src_len)
|| is_dir_sep(src_name[src_len - suffix_len - 1])) || is_dir_sep(src_name[src_len - suffix_len - 1]))
return 0; return 0;
if (strcmp(suffix, src_name + src_len - suffix_len) == 0) if (suffix_strcmp(suffix, src_name + src_len - suffix_len) == 0)
return src_len - suffix_len; return src_len - suffix_len;
return 0; return 0;