sd-device-enumerator: fix typo: contolC -> controlC

Also shorten code a bit.
This commit is contained in:
Yu Watanabe
2022-03-18 09:43:09 +01:00
committed by Lennart Poettering
parent f79856d9e8
commit 29e6f70b8d
+5 -8
View File
@@ -249,18 +249,15 @@ static int device_compare(sd_device * const *_a, sd_device * const *_b) {
prefix_len = sound_a - devpath_a;
if (strncmp(devpath_a, devpath_b, prefix_len) == 0) {
if (strneq(devpath_a, devpath_b, prefix_len)) {
const char *sound_b;
sound_b = devpath_b + prefix_len;
if (startswith(sound_a, "/controlC") &&
!startswith(sound_b, "/contolC"))
return 1;
if (!startswith(sound_a, "/controlC") &&
startswith(sound_b, "/controlC"))
return -1;
r = CMP(!!startswith(sound_a, "/controlC"),
!!startswith(sound_b, "/controlC"));
if (r != 0)
return r;
}
}
}