On Fri, 30 Jan 2026 15:26:46 -0800
Julius Werner <[email protected]> wrote:

> > > Note that if the line has a comment, it still keep searching the
> > > value to the next line::
> > >
> > >   foo = # comment
> > >   value
> 
> This seems inconsistent to me tbh. I think someone could reasonably
> write a bootconfig like this:
> 
> foo =                  # We leave foo empty here because <reason>
> bar = value
> 
> and expect it to work. There's nothing in the documentation that
> suggests empty values would behave differently if there is a comment
> behind them.

But we already accept that example in the tree.

  tools/bootconfig/samples/good-array-space-comment.bconf

So it is hard to change this syntax. But without comment, the
document defines the value is terminated with a newline. Thus
it needs to be fixed.


> 
> Also, I believe your patch might inadvertently break this case (which
> I think(?) is supposed to work):
> 
> foo = first array value,
>       second array value,
>       third array value

Oops, good catch! I should add this as a good sample.

> 
> Because __xbc_parse_value() returns from the first value with `&next`
> pointing at the newline behind the comma, and that is passed to the
> next iteration of __xbc_parse_value() which will now no longer skip
> it. I think an already started array may need to be treated as a
> special case here and you may want to add another
> skip_spaces()/skip_comment() to the loop in xbc_parse_array().

OK, let me fix it.

Thanks,

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

Reply via email to