diff mbox series

alsaucm: Fix ending with quotes commands

Message ID 20200709062412.348-1-cyueh@chromium.org (mailing list archive)
State New, archived
Headers show
Series alsaucm: Fix ending with quotes commands | expand

Commit Message

Cheng Yueh July 9, 2020, 6:24 a.m. UTC
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 <cyueh@chromium.org>
---
 alsaucm/usecase.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jaroslav Kysela July 27, 2020, 9:57 a.m. UTC | #1
Dne 09. 07. 20 v 8:24 Cheng Yueh napsal(a):
> 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
diff mbox series

Patch

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)