diff -Nru alsa-lib-1.2.3.2/debian/changelog alsa-lib-1.2.3.2/debian/changelog --- alsa-lib-1.2.3.2/debian/changelog 2020-08-25 13:13:28.000000000 +0000 +++ alsa-lib-1.2.3.2/debian/changelog 2020-10-15 00:50:24.000000000 +0000 @@ -1,3 +1,11 @@ +alsa-lib (1.2.3.2-1ubuntu2) groovy; urgency=medium + + * d/p/0001-control-ctlparse-fix-enum-values-in-or.patch + - Fix ctl parsing for enum value setting, let it support both + "" and '' (LP: #1899857) + + -- Hui Wang Thu, 15 Oct 2020 00:50:24 +0000 + alsa-lib (1.2.3.2-1ubuntu1) groovy; urgency=medium * d/p/0001-conf-USB-Audio-Disable-IEC958-on-Lenovo-ThinkStation.patch: diff -Nru alsa-lib-1.2.3.2/debian/patches/0001-control-ctlparse-fix-enum-values-in-or.patch alsa-lib-1.2.3.2/debian/patches/0001-control-ctlparse-fix-enum-values-in-or.patch --- alsa-lib-1.2.3.2/debian/patches/0001-control-ctlparse-fix-enum-values-in-or.patch 1970-01-01 00:00:00.000000000 +0000 +++ alsa-lib-1.2.3.2/debian/patches/0001-control-ctlparse-fix-enum-values-in-or.patch 2020-10-15 00:49:52.000000000 +0000 @@ -0,0 +1,62 @@ +From da1ff0f4943b04e2ebcd619ef03442279ae30374 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 27 Jul 2020 13:18:20 +0200 +Subject: [PATCH] control: ctlparse - fix enum values in '' or "" + +This comit fixes the enum value string parser +(fixes aaf3a081bff1cc85635f7a3c3d4287c4addbbd84). + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/40 +Signed-off-by: Jaroslav Kysela +(cherry picked from commit a3ca4803cb8db73d01231c69620e2d18573ffba9) +Signed-off-by: Hui Wang +--- + src/control/ctlparse.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c +index ee1e0602..74f76cca 100644 +--- a/src/control/ctlparse.c ++++ b/src/control/ctlparse.c +@@ -282,23 +282,27 @@ static int get_ctl_enum_item_index(snd_ctl_t *handle, + if (items <= 0) + return -1; + ++ end = *ptr; ++ if (end == '\'' || end == '"') ++ ptr++; ++ else ++ end = '\0'; ++ + for (i = 0; i < items; i++) { + snd_ctl_elem_info_set_item(info, i); + if (snd_ctl_elem_info(handle, info) < 0) + return -1; + name = snd_ctl_elem_info_get_item_name(info); +- end = *ptr; +- if (end == '\'' || end == '"') +- ptr++; +- else +- end = '\0'; + len = strlen(name); +- if (strncmp(name, ptr, len) == 0) { +- if (ptr[len] == end || ptr[len] == ',' || ptr[len] == '\n') { +- ptr += len; +- *ptrp = ptr; +- return i; +- } ++ if (strncmp(name, ptr, len)) ++ continue; ++ if (end == '\0' && (ptr[len] == '\0' || ptr[len] == ',' || ptr[len] == '\n')) { ++ *ptrp = ptr + len; ++ return i; ++ } ++ if (end != '\0' && ptr[len] == end) { ++ *ptrp = ptr + len + 1; ++ return i; + } + } + return -1; +-- +2.25.1 + diff -Nru alsa-lib-1.2.3.2/debian/patches/series alsa-lib-1.2.3.2/debian/patches/series --- alsa-lib-1.2.3.2/debian/patches/series 2020-08-25 13:13:20.000000000 +0000 +++ alsa-lib-1.2.3.2/debian/patches/series 2020-10-15 00:50:02.000000000 +0000 @@ -1,3 +1,5 @@ 0001-Enabled-extended-namehints-in-alsa.conf.patch 0001-conf-USB-Audio-Disable-IEC958-on-Lenovo-ThinkStation.patch + +0001-control-ctlparse-fix-enum-values-in-or.patch