]> git.baikalelectronics.ru Git - kernel.git/commit
lib/bootconfig: Fix to remove tailing spaces after value
authorMasami Hiramatsu <mhiramat@kernel.org>
Mon, 21 Sep 2020 09:44:51 +0000 (18:44 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 22 Sep 2020 01:50:09 +0000 (21:50 -0400)
commit254b252eae2a51b95a170b5b6c814dcd5f2614ff
tree4e7a57e6fe91d669c163593a6a2dc75fecbf0a3f
parentaf8a40990ae315ed97e0b0dcbc96c35a6dc704c1
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: 673d6799922c ("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>
lib/bootconfig.c