diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-11-02 20:17:25 +0100 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-11-06 11:52:57 +0200 |
commit | bb3244dee26e3c500b14830e9500cb2d3658f809 (patch) | |
tree | 197235a2c136636ffbeab1464e51a87963ea6e36 /libavformat/utils.c | |
parent | ba04ecfdacec4cf86e74b43fe8bcc09e06bb7a72 (diff) | |
download | ffmpeg-bb3244dee26e3c500b14830e9500cb2d3658f809.tar.gz |
Replace all usage of strcasecmp/strncasecmp
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: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index c13ce3da0c..78139764c0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -37,7 +37,6 @@ #include "url.h" #include <sys/time.h> #include <time.h> -#include <strings.h> #include <stdarg.h> #if CONFIG_NETWORK #include "network.h" @@ -169,7 +168,7 @@ int av_match_ext(const char *filename, const char *extensions) while (*p != '\0' && *p != ',' && q-ext1<sizeof(ext1)-1) *q++ = *p++; *q = '\0'; - if (!strcasecmp(ext1, ext)) + if (!av_strcasecmp(ext1, ext)) return 1; if (*p == '\0') break; @@ -190,11 +189,11 @@ static int match_format(const char *name, const char *names) namelen = strlen(name); while ((p = strchr(names, ','))) { len = FFMAX(p - names, namelen); - if (!strncasecmp(name, names, len)) + if (!av_strncasecmp(name, names, len)) return 1; names = p+1; } - return !strcasecmp(name, names); + return !av_strcasecmp(name, names); } AVOutputFormat *av_guess_format(const char *short_name, const char *filename, |