ucm: Fix sysw sequence command not working when requesting to ignore errors

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>
This commit is contained in:
Hans de Goede 2021-05-03 22:52:44 +02:00 committed by Jaroslav Kysela
parent 6ddba54a07
commit 06543e06e9

View 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;