path: initialize the quirks context after error checking

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-06-06 11:17:42 +10:00
parent 03a1c496ee
commit 36284defd0

View file

@ -377,13 +377,6 @@ libinput_path_add_device(struct libinput *libinput,
return NULL;
}
/* We cannot do this during path_create_context because the log
* handler isn't set up there but we really want to log to the right
* place if the quirks run into parser errors. So we have to do it
* on the first call to add_device.
*/
libinput_init_quirks(libinput);
udev_device = udev_device_from_devnode(libinput, udev, path);
if (!udev_device) {
log_bug_client(libinput, "Invalid path %s\n", path);
@ -395,6 +388,13 @@ libinput_path_add_device(struct libinput *libinput,
return NULL;
}
/* We cannot do this during path_create_context because the log
* handler isn't set up there but we really want to log to the right
* place if the quirks run into parser errors. So we have to do it
* on the first call to add_device.
*/
libinput_init_quirks(libinput);
device = path_create_device(libinput, udev_device, NULL);
udev_device_unref(udev_device);
return device;