From dd0370f73c8d8ab65d0271c11cf1b7305fe4c41e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Yhuel?= Date: Mon, 6 Apr 2020 23:48:20 +0200 Subject: [PATCH] quirks: correctly print boolean values MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When a boolean quirk is set to "0", it is correctly disabled, but "libinput quirks list" and "libinput record" showed it as "1". This happens for example if ModelXXXX=0 is set in /etc/libinput/local-overrides.quirks, to override a default quirk. Signed-off-by: Loïc Yhuel --- tools/shared.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/shared.c b/tools/shared.c index 3bd48c8..c8793b3 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -620,9 +620,11 @@ tools_list_device_quirks(struct quirks_context *ctx, do { if (quirks_has_quirk(quirks, q)) { const char *name; + bool b; name = quirk_get_name(q); - snprintf(buf, sizeof(buf), "%s=1", name); + quirks_get_bool(quirks, q, &b); + snprintf(buf, sizeof(buf), "%s=%d", name, b ? 1 : 0); callback(userdata, buf); } } while(++q < _QUIRK_LAST_MODEL_QUIRK_); -- 2.7.4