From 96949dafcca87f65902bd77a0bc56007d9cead70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 2 Nov 2011 20:17:25 +0100 Subject: Replace all strcasecmp/strncasecmp usages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All current usages of it are incompatible with localization. For example strcasecmp("i", "I") != 0 is possible, but would break many of the places where it is used. Instead use our own implementations that always treat the data as ASCII. Signed-off-by: Reimar Döffinger --- libavutil/avstring.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavutil/avstring.h') diff --git a/libavutil/avstring.h b/libavutil/avstring.h index 0b2205a9be..3fb3fbaf04 100644 --- a/libavutil/avstring.h +++ b/libavutil/avstring.h @@ -165,4 +165,16 @@ char *av_get_token(const char **buf, const char *term); */ char *av_strtok(char *s, const char *delim, char **saveptr); +/** + * Locale independent case-insensitive compare. + * Note: This means only ASCII-range characters are case-insensitive + */ +int av_strcasecmp(const char *a, const char *b); + +/** + * Locale independent case-insensitive compare. + * Note: This means only ASCII-range characters are case-insensitive + */ +int av_strncasecmp(const char *a, const char *b, size_t n); + #endif /* AVUTIL_AVSTRING_H */ -- cgit v1.2.3