From c748d12b45a35a83ad1cce708eac3f1e46a48189 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Sat, 17 Aug 2002 14:54:47 +0000 Subject: [PATCH] fix bug where comparing vorbis comment field names were not case insensitive --- src/metaflac/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/metaflac/main.c b/src/metaflac/main.c index f8b0623..826f3f0 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) -- 2.7.4