All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsaucm: Fix ending with quotes commands
@ 2020-07-09  6:24 Cheng Yueh
  2020-07-27  9:57 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng Yueh @ 2020-07-09  6:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: Cheng Yueh

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(+)

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)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] alsaucm: Fix ending with quotes commands
  2020-07-09  6:24 [PATCH] alsaucm: Fix ending with quotes commands Cheng Yueh
@ 2020-07-27  9:57 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2020-07-27  9:57 UTC (permalink / raw)
  To: Cheng Yueh, alsa-devel

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

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-27  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09  6:24 [PATCH] alsaucm: Fix ending with quotes commands Cheng Yueh
2020-07-27  9:57 ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.