Skip to contentSkip to conversation

alsaucm: Fix ending with quotes commands

PATCH Applied Cheng Yueh 2 participants 2 messages Jul 9, 2020 – Jul 27, 2020

lore
Share & tools
lore

Cheng Yueh

author
#0 lore raw

PATCH 1/1 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.

---
 alsaucm/usecase.c | 2 ++
 1 file changed, 2 insertions(+)
alsaucm/usecase.c +2 -0
index 1ed91ea..d39a159 100644
@@ -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)
Signature · 1 line
2.26.2
#1 lore raw

Dne 09. 07. 20 v 8:24 Cheng Yueh napsal(a):

Quoted 6 lines

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.

Applied. Thank you.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.