From 222dc8a239f7578cecdcb21523052140aa1192cf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Oct 2013 08:42:55 +0200 Subject: Util/ASCII: add StringEqualsCaseASCII() overload with length Replaces GLib's g_ascii_strncasecmp(). --- src/decoder/FlacMetadata.cxx | 3 ++- src/decoder/VorbisComments.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/FlacMetadata.cxx b/src/decoder/FlacMetadata.cxx index 99659d143..a9c57d926 100644 --- a/src/decoder/FlacMetadata.cxx +++ b/src/decoder/FlacMetadata.cxx @@ -25,6 +25,7 @@ #include "tag/TagTable.hxx" #include "tag/TagBuilder.hxx" #include "ReplayGainInfo.hxx" +#include "util/ASCII.hxx" #include @@ -135,7 +136,7 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *comment = (const char*)entry->entry; if (entry->length <= name_length || - g_ascii_strncasecmp(comment, name, name_length) != 0) + StringEqualsCaseASCII(comment, name, name_length)) return nullptr; if (comment[name_length] == '=') { diff --git a/src/decoder/VorbisComments.cxx b/src/decoder/VorbisComments.cxx index 773eca261..44648884a 100644 --- a/src/decoder/VorbisComments.cxx +++ b/src/decoder/VorbisComments.cxx @@ -25,6 +25,7 @@ #include "tag/TagHandler.hxx" #include "tag/TagBuilder.hxx" #include "ReplayGainInfo.hxx" +#include "util/ASCII.hxx" #include @@ -38,7 +39,7 @@ vorbis_comment_value(const char *comment, const char *needle) { size_t len = strlen(needle); - if (g_ascii_strncasecmp(comment, needle, len) == 0 && + if (StringEqualsCaseASCII(comment, needle, len) && comment[len] == '=') return comment + len + 1; -- cgit v1.2.3