Util/ASCII: add StringEqualsCaseASCII() overload with length
Replaces GLib's g_ascii_strncasecmp().
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user