From 5c6f892d411670e3060f4bc309402617a209e57c Mon Sep 17 00:00:00 2001 From: Kelvin Lee Date: Tue, 5 Sep 2023 15:05:09 +0300 Subject: MSVC: xz: Use _stricmp() instead of strcasecmp() in suffix.c. --- src/xz/suffix.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xz/suffix.c b/src/xz/suffix.c index 6ce97878..2df2b8c8 100644 --- a/src/xz/suffix.c +++ b/src/xz/suffix.c @@ -21,7 +21,13 @@ # ifdef HAVE_STRINGS_H # include # endif -# define strcmp strcasecmp +# ifdef _MSC_VER +# define suffix_strcmp _stricmp +# else +# define suffix_strcmp strcasecmp +# endif +#else +# define suffix_strcmp strcmp #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])) 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 0; -- cgit v1.2.3