mirror of
https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
synced 2026-10-24 00:48:53 +03:00
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().
Fixes: 8ffb648928 ("tools: line name focussed rework")
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20250321-gpioinfo-unnamed-quotes-v1-1-a806e9027adf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>