diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-10-20 15:25:51 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-10-26 15:35:07 +1000 |
commit | 28d8855cd4e3be8831fb1c17bf1d205bd8465d1e (patch) | |
tree | 22651578b4b6e11f7447b0b2a87bf4164800b55f /hw | |
parent | 7fc96fb02dade4a86f2fc038f3cf5f2d9c0cda00 (diff) |
xfree86: use the right option traversal list to search for an option
They're identically laid-out structs but let's use the right type to search
for our desired value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 538b11027..e31aab31e 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -1541,23 +1541,19 @@ void xf86InputEnableVTProbe(void) { int i, is_auto = 0; - InputOption *option = NULL; DeviceIntPtr pdev; for (i = 0; i < new_input_devices_count; i++) { InputInfoPtr pInfo = new_input_devices[i]; + const char *value = xf86findOptionValue(pInfo->options, "_source"); is_auto = 0; - nt_list_for_each_entry(option, pInfo->options, list.next) { - const char *key = input_option_get_key(option); - const char *value = input_option_get_value(option); - - if (strcmp(key, "_source") == 0 && - (strcmp(value, "server/hal") == 0 || - strcmp(value, "server/udev") == 0 || - strcmp(value, "server/wscons") == 0)) - is_auto = 1; - } + if (value && + (strcmp(value, "server/hal") == 0 || + strcmp(value, "server/udev") == 0 || + strcmp(value, "server/wscons") == 0)) + is_auto = 1; + xf86NewInputDevice(pInfo, &pdev, (!is_auto || (is_auto && xf86Info.autoEnableDevices))); |