summaryrefslogtreecommitdiff
path: root/lib/bootconfig.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-09-21 18:44:51 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-09-21 21:50:09 -0400
commitc7af4ecdffe1537ba8aeed0ac12c3326f908df43 (patch)
tree4e7a57e6fe91d669c163593a6a2dc75fecbf0a3f /lib/bootconfig.c
parentead1e19ad905b97261f0ad7a98bb64abb9323b2b (diff)
downloadlwn-c7af4ecdffe1537ba8aeed0ac12c3326f908df43.tar.gz
lwn-c7af4ecdffe1537ba8aeed0ac12c3326f908df43.zip
lib/bootconfig: Fix to remove tailing spaces after value
Fix to remove tailing spaces after value. If there is a space after value, the bootconfig failed to remove it because it applies strim() before replacing the delimiter with null. For example, foo = var # comment was parsed as below. foo="var " but user will expect foo="var" This fixes it by applying strim() after removing the delimiter. Link: https://lkml.kernel.org/r/160068149134.1088739.8868306567670058853.stgit@devnote2 Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support") Cc: Ingo Molnar <mingo@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'lib/bootconfig.c')
-rw-r--r--lib/bootconfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index b44bba0f1583..649ed44f199c 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -494,8 +494,8 @@ static int __init __xbc_parse_value(char **__v, char **__n)
break;
}
if (strchr(",;\n#}", c)) {
- v = strim(v);
*p++ = '\0';
+ v = strim(v);
break;
}
}