diff options
author | Kelvin Lee <kiyolee@gmail.com> | 2023-09-05 15:05:09 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2023-09-22 20:00:38 +0300 |
commit | 5c6f892d411670e3060f4bc309402617a209e57c (patch) | |
tree | 10583d08aa59b8fa184f4db7787cf70e6ab047b4 /src | |
parent | MSVC: xz: Use _isatty() from <io.h> to implement isatty(). (diff) | |
download | xz-5c6f892d411670e3060f4bc309402617a209e57c.tar.xz |
MSVC: xz: Use _stricmp() instead of strcasecmp() in suffix.c.
Diffstat (limited to 'src')
-rw-r--r-- | src/xz/suffix.c | 10 |
1 files 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 <strings.h> # 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; |