Commit 3a1344bc authored by sezero's avatar sezero Committed by Thomas Daede

info.c (tagcompare): use a locale-insensitive toupper()

see: #2079
parent 603cd941
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <ogg/ogg.h> #include <ogg/ogg.h>
#include "vorbis/codec.h" #include "vorbis/codec.h"
#include "codec_internal.h" #include "codec_internal.h"
...@@ -47,6 +46,10 @@ static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){ ...@@ -47,6 +46,10 @@ static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
} }
} }
static int _v_toupper(int c) {
return (c >= 'a' && c <= 'z') ? (c & ~('a' - 'A')) : c;
}
void vorbis_comment_init(vorbis_comment *vc){ void vorbis_comment_init(vorbis_comment *vc){
memset(vc,0,sizeof(*vc)); memset(vc,0,sizeof(*vc));
} }
...@@ -78,7 +81,7 @@ void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *con ...@@ -78,7 +81,7 @@ void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *con
static int tagcompare(const char *s1, const char *s2, int n){ static int tagcompare(const char *s1, const char *s2, int n){
int c=0; int c=0;
while(c < n){ while(c < n){
if(toupper(s1[c]) != toupper(s2[c])) if(_v_toupper(s1[c]) != _v_toupper(s2[c]))
return !0; return !0;
c++; c++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment