From 15539cd0e660e90635c90fc7862534c972c4b0c8 Mon Sep 17 00:00:00 2001 From: Cheng Yueh Date: Thu, 9 Jul 2020 14:24:12 +0800 Subject: [PATCH] alsaucm: Fix ending with quotes commands If we use 'alsaucm -n -b -' with 'get "CapturePCM/Internal Mic"' then the alsaucm will report error and stop immediately. The reason is that the parse_line in usecase.c appends an empty argument if a command ends with quotes. This change adds a patch to fix the parse_line function in usecase.c. Signed-off-by: Cheng Yueh Signed-off-by: Jaroslav Kysela --- alsaucm/usecase.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alsaucm/usecase.c b/alsaucm/usecase.c index 1ed91ea..d39a159 100644 --- a/alsaucm/usecase.c +++ b/alsaucm/usecase.c @@ -130,6 +130,8 @@ static int parse_line(struct context *context, char *line) *line == '\n')) line++; c = *line; + if (c == '\0') + return 0; if (c == '\"' || c == '\'') { start = ++line; while (*line && *line != c)