bring pandora to buildable state. Some cleanups and fixes along the way.
[libpicofe.git] / common / input.c
index 1dae2bd..81f6e16 100644 (file)
@@ -257,8 +257,8 @@ int in_update_keycode(int *dev_id_out, int *is_down_out, int timeout_ms)
        int result = -1, dev_id = 0, is_down, result_menu;
        int fds_hnds[IN_MAX_DEVS];
        int i, ret, count = 0;
+       in_drv_t *drv = NULL;
        unsigned int ticks;
-       in_drv_t *drv;
 
        if (in_have_async_devs) {
                result = in_update_kc_async(&dev_id, &is_down, timeout_ms);
@@ -426,9 +426,10 @@ const char *in_get_dev_name(int dev_id, int must_be_active, int skip_pfix)
                return NULL;
 
        name = in_devices[dev_id].name;
-       if (name == NULL)
-               return NULL;
+       if (name == NULL || !skip_pfix)
+               return name;
 
+       /* skip prefix */
        tmp = strchr(name, ':');
        if (tmp != NULL)
                name = tmp + 1;