summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2002-08-17 14:54:47 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2002-08-17 14:54:47 +0000
commitc748d12b45a35a83ad1cce708eac3f1e46a48189 (patch)
tree77d1603f5993f7b92c9370b8b42da7f62c9850f4
parenta0ac09adeae50b41b4047d68aead7b545297750c (diff)
downloadflac-c748d12b45a35a83ad1cce708eac3f1e46a48189.tar.gz
fix bug where comparing vorbis comment field names were not case insensitive
-rw-r--r--src/metaflac/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/metaflac/main.c b/src/metaflac/main.c
index f8b06231..826f3f0a 100644
--- a/src/metaflac/main.c
+++ b/src/metaflac/main.c
@@ -1739,7 +1739,8 @@ FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const
FLAC__bool field_name_matches_entry(const char *field_name, unsigned field_name_length, const FLAC__StreamMetadata_VorbisComment_Entry *entry)
{
- return (0 != memchr(entry->entry, '=', entry->length) && 0 == strncmp(field_name, entry->entry, field_name_length));
+ FLAC__byte *eq = memchr(entry->entry, '=', entry->length);
+ return (0 != eq && (unsigned)(eq-entry->entry) == field_name_length && 0 == strncasecmp(field_name, entry->entry, field_name_length));
}
void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent)