]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: Fix sysw sequence command not working when requesting to ignore errors
authorHans de Goede <hdegoede@redhat.com>
Mon, 3 May 2021 20:52:44 +0000 (22:52 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 4 May 2021 08:36:22 +0000 (10:36 +0200)
When the user requests to ignore sysfs write errors by prefixing
the path with a '-' then we need to skip the '-' when building the
actual path otherwise the write will never work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/main.c

index 2b07cc95ef4515363cddfc3e46ce723a5b9185e4..3df9b62a58458640525c53a8c38a180470b36602 100644 (file)
@@ -517,7 +517,10 @@ static int execute_sysw(const char *sysw)
        if (sysw == NULL || *sysw == '\0')
                return 0;
 
-       ignore_error = sysw[0] == '-';
+       if (sysw[0] == '-') {
+               ignore_error = true;
+               sysw++;
+       }
 
        if (sysw[0] == ':')
                return -EINVAL;