All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libkmod-config: more chars allowed as space
@ 2021-03-10 17:26 Lucas De Marchi
  2021-03-15 20:25 ` Lucas De Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas De Marchi @ 2021-03-10 17:26 UTC (permalink / raw)
  To: linux-modules

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


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

* Re: [PATCH] libkmod-config: more chars allowed as space
  2021-03-10 17:26 [PATCH] libkmod-config: more chars allowed as space Lucas De Marchi
@ 2021-03-15 20:25 ` Lucas De Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Lucas De Marchi @ 2021-03-15 20:25 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

On Wed, Mar 10, 2021 at 9:31 AM Lucas De Marchi
<lucas.demarchi@intel.com> 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

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

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

end of thread, other threads:[~2021-03-15 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 17:26 [PATCH] libkmod-config: more chars allowed as space Lucas De Marchi
2021-03-15 20:25 ` Lucas De Marchi

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.