Util/ASCII: add StringEqualsCaseASCII() overload with length

Replaces GLib's g_ascii_strncasecmp().
This commit is contained in:
Max Kellermann
2013-10-21 08:42:55 +02:00
parent 0e4d2e7277
commit 222dc8a239
6 changed files with 23 additions and 11 deletions

View File

@@ -21,12 +21,11 @@
#include "MixerInternal.hxx"
#include "OutputAPI.hxx"
#include "system/fd_util.h"
#include "util/ASCII.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
#include <glib.h>
#include <assert.h>
#include <string.h>
#include <sys/stat.h>
@@ -71,7 +70,7 @@ oss_find_mixer(const char *name)
size_t name_length = strlen(name);
for (unsigned i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
if (g_ascii_strncasecmp(name, labels[i], name_length) == 0 &&
if (StringEqualsCaseASCII(name, labels[i], name_length) &&
(labels[i][name_length] == 0 ||
labels[i][name_length] == ' '))
return i;