go-uci icon indicating copy to clipboard operation
go-uci copied to clipboard

Parse error when option is empty

Open jalin107 opened this issue 5 years ago • 7 comments

jalin107 avatar Jun 02 '20 06:06 jalin107

I'm sorry, I don't speak nor read chinese. Google translates your issue into:

When the option item is empty, a parse err error will occur and the desired object cannot be parsed

Is that translation correct? If so, what do you mean by "when the option item is emtpy"?

dmke avatar Jun 02 '20 09:06 dmke

yes.

jalin107 avatar Jun 03 '20 10:06 jalin107

I have identified this behaviour on my OpenWRT router:

# cat /etc/config/test
config section
	option empty1
	option empty2 ''
	list empty3
	list empty4 ''

# uci export test
package test

config section
	list empty3 ''
	list empty4 ''

It was easy to extend the lexer to recognize the empty/missing values properly (I personally would consider an option without value invalid.)

To fix the parser, I'll need some more time (but I don't know when that will be). Feel free to extend on e84480d if you don't want to wait :-)

dmke avatar Jun 08 '20 18:06 dmke

3 years later; any update?

SmartBoy84 avatar Jan 04 '23 16:01 SmartBoy84

Nope, still very low on my priorities.

Feel free to submit a patch though, I'll happily merge it.

dmke avatar Jan 04 '23 16:01 dmke

Any progress? This library cannot parse aria2 default config.

jjm2473 avatar Apr 07 '23 03:04 jjm2473

No, sorry. At the moment (and for the foreseeable future), we have close to zero maintenance capacity for this. Our use-cases are covered, so active development is de-facto halted.

dmke avatar Apr 11 '23 08:04 dmke