summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Yhuel <loic.yhuel@softathome.com>2020-04-06 23:48:20 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2020-06-17 12:09:28 +1000
commitf9f9bc5927d9a512b806e3f968b84d79ae70aaea (patch)
tree066432d4ea20a9a1db2d5c3c9cdebce0d75bdb39
parent86d81a0ac7f2b68327f3ed49f609ccfde5a0ce43 (diff)
downloadlibinput-f9f9bc5927d9a512b806e3f968b84d79ae70aaea.tar.gz
quirks: correctly print boolean values
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 <loic.yhuel@softathome.com> (cherry picked from commit dd0370f73c8d8ab65d0271c11cf1b7305fe4c41e)
-rw-r--r--tools/shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/shared.c b/tools/shared.c
index 3bd48c84..c8793b3e 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_);