Skip to content

bootconfig: Fix a parser bug

Masami Hiramatsu lkml 1 version In review

Get series with b4
b4 am 160068147328.1088739.7282405187565509762.stgit@devnote2

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib/bootconfig: Fix a bug of breaking existing tree nodeslib/bootconfig.c+23 -130 replies
2/4lib/bootconfig: Fix to remove tailing spaces after valuelib/bootconfig.c+1 -10 replies
3/4tools/bootconfig: Add testcases for repeated key with bracetools/bootconfig/test-bootconfig.sh+12 -00 replies
4/4tools/bootconfig: Add testcase for tailing spacetools/bootconfig/test-bootconfig.sh+13 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] bootconfig: Fix a parser bug

Hi,

Here are patches to fix 2 bugs in the parser. One issue happens when a key has a siblings and the key repeated with brace after sibling nodes. Another one is that the parser keeps tailing spaces when we put a comment on the line.

For example, the minimum example of the 1st issue is here;

foo
bar
foo { buz }

This should be parsed as

foo.buz
bar

But the bootconfig parser parses it as foo.buz (no bar node) because foo->bar link is unlinked when the brace ("foo {") was found.

The second one is simpler, if we have

foo = val # comment

The value's space after the word was not removed.

foo="val "

But this also should be

foo="val"

If user needs tailing spaces, they can use quotes, e.g.

foo = "val " # comment

Thank you,

---

Masami Hiramatsu (4):
lib/bootconfig: Fix a bug of breaking existing tree nodes lib/bootconfig: Fix to remove tailing spaces after value tools/bootconfig: Add testcases for repeated key with brace tools/bootconfig: Add testcase for tailing space

 tools/bootconfig/test-bootconfig.sh |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

--
Masami Hiramatsu (Linaro) <[email protected]>