diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-11-02 20:17:25 +0100 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-11-03 19:25:26 +0100 |
commit | 96949dafcca87f65902bd77a0bc56007d9cead70 (patch) | |
tree | e394623e56efc86b70d3e7fbdefc2555457b3aa3 /libavformat/utils.c | |
parent | 475fb67d0b391ad1e8e3e8e3d65d7e6892e17e7a (diff) | |
download | ffmpeg-96949dafcca87f65902bd77a0bc56007d9cead70.tar.gz |
Replace all strcasecmp/strncasecmp usages.
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 <Reimar.Doeffinger@gmx.de>
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 333946c172..855992e2aa 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -38,7 +38,6 @@ #include "url.h" #include <sys/time.h> #include <time.h> -#include <strings.h> #include <stdarg.h> #if CONFIG_NETWORK #include "network.h" @@ -170,7 +169,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; @@ -191,11 +190,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, |