On Fri, Mar 21, 2025 at 12:05:24PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx> > > Consider the following output of `gpioinfo`: > > gpiochip1 - 2 lines: > line 0: "foo" output > line 1: unnamed output > > Now let's run: > > gpioset --chip=gpiochip1 0=active 1=active > > The output of `gpioinfo --unquoted` is correct: > > gpiochip1 - 2 lines: > line 0: foo output consumer=gpioset > line 1: unnamed output consumer=gpioset > > However, without the `unquoted` switch, it's inconsistent: > > gpiochip1 - 2 lines: > line 0: "foo" output consumer="gpioset" > line 1: unnamed output consumer=gpioset > > This is because gpioinfo drops the quotes for all subsequent attribute > strings when it encounters an unnamed line. We should instead keep a > separate instance of the `unquoted` flag just for the line name and pass > the original value of `unquoted_strings` down to > print_line_attributes(). > Oh nuts, originally the consumer was a separate field, so the line name was the only string in the info. I didn't consider that when making the consumer an attribute :(. The fix and test look good to me. Reviewed-by: Kent Gibson <warthog618@xxxxxxxxx> Cheers, Kent.