linux-stable/tools/bootconfig
Masami Hiramatsu 89b74cac78 tools/bootconfig: Show line and column in parse error
Show line and column when we got a parse error in bootconfig tool.
Current lib/bootconfig shows the parse error with byte offset, but
that is not human readable.
This makes xbc_init() not showing error message itself but able to
pass the error message and position to caller, so that the caller
can decode it and show the error message with line number and columns.

With this patch, bootconfig tool shows an error with line:column as
below.

  $ cat samples/bad-dotword.bconf
  # do not start keyword with .
  key {
    .word = 1
  }
  $ ./bootconfig -a samples/bad-dotword.bconf initrd
  Parse Error: Invalid keyword at 3:3

Link: http://lkml.kernel.org/r/158323469002.10560.4023923847704522760.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-03-03 17:38:42 -05:00
..
include/linux tools/bootconfig: Remove unneeded error message silencer 2020-02-20 17:53:41 -05:00
samples bootconfig: Prohibit re-defining value on same key 2020-02-21 09:59:19 -05:00
.gitignore tools: bootconfig: Add bootconfig command 2020-01-13 13:19:39 -05:00
main.c tools/bootconfig: Show line and column in parse error 2020-03-03 17:38:42 -05:00
Makefile bootconfig: Support O=<builddir> option 2020-03-03 17:38:42 -05:00
test-bootconfig.sh bootconfig: Support O=<builddir> option 2020-03-03 17:38:42 -05:00