Skip to content

Commit c7af4ec

Browse files
mhiramatrostedt
authored andcommitted
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: 76db5a2 ("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>
1 parent ead1e19 commit c7af4ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/bootconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ static int __init __xbc_parse_value(char **__v, char **__n)
494494
break;
495495
}
496496
if (strchr(",;\n#}", c)) {
497-
v = strim(v);
498497
*p++ = '\0';
498+
v = strim(v);
499499
break;
500500
}
501501
}

0 commit comments

Comments
 (0)