[PATCH] libkmod-config: more chars allowed as space

Subsystems: the rest

STALE2002d

2 messages, 2 authors, 2021-03-15 · open the first message on its own page

[PATCH] libkmod-config: more chars allowed as space

From: Lucas De Marchi <hidden>
Date: 2021-03-10 17:28:08

Recently in a discussion I noticed that kernel allows more chars to be
considered as space in the kernel command line. Switch to the equivalent
of isspace() instead of considering only ' '.
---
 libkmod/libkmod-config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 2873f06..4fdd40f 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -543,11 +543,14 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
 
 			break;
 		case '\0':
-		case '\n':
-			/* Stop iterating on new chars */
 			iter = false;
 			/* fall-through */
 		case ' ':
+		case '\n':
+		case '\t':
+		case '\v':
+		case '\f':
+		case '\r':
 			if (is_quoted && state == STATE_VALUE) {
 				/* no state change*/;
 			} else if (is_quoted) {
-- 
2.30.1

Re: [PATCH] libkmod-config: more chars allowed as space

From: Lucas De Marchi <hidden>
Date: 2021-03-15 20:27:09

On Wed, Mar 10, 2021 at 9:31 AM Lucas De Marchi
[off-list ref] wrote:
Recently in a discussion I noticed that kernel allows more chars to be
considered as space in the kernel command line. Switch to the equivalent
of isspace() instead of considering only ' '.
Applied,

Lucas De Marchi
quoted hunk
---
 libkmod/libkmod-config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 2873f06..4fdd40f 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -543,11 +543,14 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)

                        break;
                case '\0':
-               case '\n':
-                       /* Stop iterating on new chars */
                        iter = false;
                        /* fall-through */
                case ' ':
+               case '\n':
+               case '\t':
+               case '\v':
+               case '\f':
+               case '\r':
                        if (is_quoted && state == STATE_VALUE) {
                                /* no state change*/;
                        } else if (is_quoted) {
--
2.30.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help