]> diplodocus.org Git - xorg-xinput/commitdiff
Enclose property and device names in quotes
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 17 Feb 2012 00:33:06 +0000 (10:33 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 21 Feb 2012 01:19:08 +0000 (11:19 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
12 files changed:
src/buttonmap.c
src/feedback.c
src/hierarchy.c
src/property.c
src/setcp.c
src/setint.c
src/setmode.c
src/setptr.c
src/state.c
src/test.c
src/transform.c
src/xinput.c

index 7fed9273232526e8b08aeeb99c37365e364d983c..3396e7544831ad2465b532513ae993858e210289 100644 (file)
@@ -45,7 +45,7 @@ get_button_map(Display        *display,
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
@@ -109,7 +109,7 @@ set_button_map(Display      *display,
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index 3fad9a94bf444cf3e088a4463a79c51754827b4b..71eb155ae00858bc1f8d21121738498c72a7a2fd 100644 (file)
@@ -46,14 +46,14 @@ set_ptr_feedback(Display    *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-       fprintf(stderr, "unable to open device %s\n", argv[0]);
+       fprintf(stderr, "unable to open device '%s'\n", argv[0]);
        return 1;
     }
 
        return 1;
     }
 
@@ -68,7 +68,7 @@ set_ptr_feedback(Display      *display,
     }
 
     if (id == -1) {
     }
 
     if (id == -1) {
-       fprintf(stderr, "unable to find PtrFeedbackClass for %s\n", argv[0]);
+       fprintf(stderr, "unable to find PtrFeedbackClass for '%s'\n", argv[0]);
        return 1;
     }
 
        return 1;
     }
 
@@ -112,14 +112,14 @@ get_feedbacks(Display     *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-       fprintf(stderr, "unable to open device %s\n", argv[0]);
+       fprintf(stderr, "unable to open device '%s'\n", argv[0]);
        return 1;
     }
 
        return 1;
     }
 
index 453fb3fc7d0585d79d3963208e2643d5030318be..f3eb37869ea3f518ebc57bca04ea4df9710fbbd5 100644 (file)
@@ -74,7 +74,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
@@ -97,7 +97,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
         if (argc >= 3) {
             info = xi2_find_device_info(dpy, argv[2]);
             if (!info) {
         if (argc >= 3) {
             info = xi2_find_device_info(dpy, argv[2]);
             if (!info) {
-                fprintf(stderr, "unable to find device %s\n", argv[2]);
+                fprintf(stderr, "unable to find device '%s'\n", argv[2]);
                 return EXIT_FAILURE;
             }
 
                 return EXIT_FAILURE;
             }
 
@@ -108,7 +108,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
         if (argc >= 4) {
             info = xi2_find_device_info(dpy, argv[3]);
             if (!info) {
         if (argc >= 4) {
             info = xi2_find_device_info(dpy, argv[3]);
             if (!info) {
-                fprintf(stderr, "unable to find device %s\n", argv[3]);
+                fprintf(stderr, "unable to find device '%s'\n", argv[3]);
                 return EXIT_FAILURE;
             }
 
                 return EXIT_FAILURE;
             }
 
@@ -155,12 +155,12 @@ change_attachment(Display* dpy, int argc, char** argv, char *name, char* desc)
     md_info= xi2_find_device_info(dpy, argv[1]);
 
     if (!sd_info) {
     md_info= xi2_find_device_info(dpy, argv[1]);
 
     if (!sd_info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
     if (!md_info) {
        return EXIT_FAILURE;
     }
 
     if (!md_info) {
-       fprintf(stderr, "unable to find device %s\n", argv[1]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[1]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
@@ -191,7 +191,7 @@ float_device(Display* dpy, int argc, char** argv, char* name, char* desc)
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index ad74f230ef4911c2155ea24576de111d2b369ec0..7723445f22659eaa8c3efc0f6f6716425fdee274 100644 (file)
@@ -125,7 +125,7 @@ print_property(Display *dpy, XDevice* dev, Atom property)
                         break;
                     }
 
                         break;
                     }
 
-                    printf("\t... of unknown type %s\n",
+                    printf("\t... of unknown type '%s'\n",
                             XGetAtomName(dpy, act_type));
                     done = True;
                     break;
                             XGetAtomName(dpy, act_type));
                     done = True;
                     break;
@@ -165,7 +165,7 @@ list_props_xi1(Display *dpy, int argc, char** argv, char* name, char *desc)
         info = find_device_info(dpy, argv[i], False);
         if (!info)
         {
         info = find_device_info(dpy, argv[i], False);
         if (!info)
         {
-            fprintf(stderr, "unable to find device %s\n", argv[i]);
+            fprintf(stderr, "unable to find device '%s'\n", argv[i]);
             continue;
         }
 
             continue;
         }
 
@@ -212,7 +212,7 @@ int watch_props(Display *dpy, int argc, char** argv, char* n, char *desc)
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
@@ -253,7 +253,7 @@ delete_prop_xi1(Display *dpy, int argc, char** argv, char* n, char *desc)
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
@@ -303,14 +303,14 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
     dev = XOpenDevice(dpy, info->id);
     if (!dev)
     {
         return EXIT_FAILURE;
     }
 
     dev = XOpenDevice(dpy, info->id);
     if (!dev)
     {
-        fprintf(stderr, "unable to open device %s\n", argv[0]);
+        fprintf(stderr, "unable to open device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
@@ -319,7 +319,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
-        fprintf(stderr, "invalid property %s\n", name);
+        fprintf(stderr, "invalid property '%s'\n", name);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
@@ -330,7 +330,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
         if (XGetDeviceProperty(dpy, dev, prop, 0, 0, False, AnyPropertyType,
                                &old_type, &old_format, &act_nitems,
                                &bytes_after, &data.c) != Success) {
         if (XGetDeviceProperty(dpy, dev, prop, 0, 0, False, AnyPropertyType,
                                &old_type, &old_format, &act_nitems,
                                &bytes_after, &data.c) != Success) {
-            fprintf(stderr, "failed to get property type and format for %s\n",
+            fprintf(stderr, "failed to get property type and format for '%s'\n",
                     name);
             return EXIT_FAILURE;
         } else {
                     name);
             return EXIT_FAILURE;
         } else {
@@ -344,7 +344,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     }
 
     if (type == None) {
     }
 
     if (type == None) {
-        fprintf(stderr, "property %s doesn't exist, you need to specify "
+        fprintf(stderr, "property '%s' doesn't exist, you need to specify "
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
@@ -366,29 +366,29 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
                     data.l[i] = atoi(argv[2 + i]);
                     break;
                 default:
                     data.l[i] = atoi(argv[2 + i]);
                     break;
                 default:
-                    fprintf(stderr, "unexpected size for property %s", name);
+                    fprintf(stderr, "unexpected size for property '%s'", name);
                     return EXIT_FAILURE;
             }
         } else if (type == float_atom) {
             if (format != 32) {
                     return EXIT_FAILURE;
             }
         } else if (type == float_atom) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             *(float *)(data.l + i) = strtod(argv[2 + i], &endptr);
             if (endptr == argv[2 + i]) {
                         format, name);
                 return EXIT_FAILURE;
             }
             *(float *)(data.l + i) = strtod(argv[2 + i], &endptr);
             if (endptr == argv[2 + i]) {
-                fprintf(stderr, "argument %s could not be parsed\n", argv[2 + i]);
+                fprintf(stderr, "argument '%s' could not be parsed\n", argv[2 + i]);
                 return EXIT_FAILURE;
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
                 return EXIT_FAILURE;
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             data.a[i] = parse_atom(dpy, argv[2 + i]);
         } else {
                         format, name);
                 return EXIT_FAILURE;
             }
             data.a[i] = parse_atom(dpy, argv[2 + i]);
         } else {
-            fprintf(stderr, "unexpected type for property %s\n", name);
+            fprintf(stderr, "unexpected type for property '%s'\n", name);
             return EXIT_FAILURE;
         }
     }
             return EXIT_FAILURE;
         }
     }
@@ -592,7 +592,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
-        fprintf(stderr, "invalid property %s\n", name);
+        fprintf(stderr, "invalid property '%s'\n", name);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
@@ -603,7 +603,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
         if (XIGetProperty(dpy, info->deviceid, prop, 0, 0, False,
                           AnyPropertyType, &old_type, &old_format, &act_nitems,
                           &bytes_after, &data.c) != Success) {
         if (XIGetProperty(dpy, info->deviceid, prop, 0, 0, False,
                           AnyPropertyType, &old_type, &old_format, &act_nitems,
                           &bytes_after, &data.c) != Success) {
-            fprintf(stderr, "failed to get property type and format for %s\n",
+            fprintf(stderr, "failed to get property type and format for '%s'\n",
                     name);
             return EXIT_FAILURE;
         } else {
                     name);
             return EXIT_FAILURE;
         } else {
@@ -617,7 +617,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
     }
 
     if (type == None) {
     }
 
     if (type == None) {
-        fprintf(stderr, "property %s doesn't exist, you need to specify "
+        fprintf(stderr, "property '%s' doesn't exist, you need to specify "
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
@@ -644,7 +644,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
             }
         } else if (type == float_atom) {
             if (format != 32) {
             }
         } else if (type == float_atom) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
                         format, name);
                 return EXIT_FAILURE;
             }
@@ -655,13 +655,13 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             data.l[i] = parse_atom(dpy, argv[2 + i]);
         } else {
                         format, name);
                 return EXIT_FAILURE;
             }
             data.l[i] = parse_atom(dpy, argv[2 + i]);
         } else {
-            fprintf(stderr, "unexpected type for property %s\n", name);
+            fprintf(stderr, "unexpected type for property '%s'\n", name);
             return EXIT_FAILURE;
         }
     }
             return EXIT_FAILURE;
         }
     }
@@ -781,11 +781,11 @@ int set_prop(Display *display, int argc, char *argv[], char *name,
         } else if (!strncmp(argv[i], "--format=", strlen("--format="))) {
             format = atoi(option + 1);
             if (format != 8 && format != 16 && format != 32) {
         } else if (!strncmp(argv[i], "--format=", strlen("--format="))) {
             format = atoi(option + 1);
             if (format != 8 && format != 16 && format != 32) {
-                fprintf(stderr, "invalid property format %s\n", option + 1);
+                fprintf(stderr, "invalid property format '%s'\n", option + 1);
                 return EXIT_FAILURE;
             }
         } else {
                 return EXIT_FAILURE;
             }
         } else {
-            fprintf(stderr, "invalid option %s\n", argv[i]);
+            fprintf(stderr, "invalid option '%s'\n", argv[i]);
             return EXIT_FAILURE;
         }
 
             return EXIT_FAILURE;
         }
 
index 8a04462bead3c3415998ba0827a8b6bb2f61e89f..649f301424cc96c9993936f8c51a2d40966cd3e2 100644 (file)
@@ -49,7 +49,7 @@ set_clientpointer(Display* dpy, int argc, char** argv, char* name, char *desc)
     info = xi2_find_device_info(dpy, argv[1]);
 
     if (!info) {
     info = xi2_find_device_info(dpy, argv[1]);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[1]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[1]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index 7e7870a5f40c17faf21576cc552b6faa488917d3..050a4112fe21f82448fdb3348c2d3dc6ce3bf822 100644 (file)
@@ -47,7 +47,7 @@ set_integer_feedback(Display  *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index 6812fdfd6a7e964aca9a38ab14868522151cd336..4008a74dbab619e25686e1e9edf445d1240b4633 100644 (file)
@@ -43,7 +43,7 @@ set_mode(Display      *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index f6f9410f80fd34f318cc7d1eb22eb75aee9b3475..3dcf1ec9c9f1f992487717b321be34b9d28e83de 100644 (file)
@@ -48,7 +48,7 @@ set_pointer(Display   *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return EXIT_FAILURE;
     }
 
        return EXIT_FAILURE;
     }
 
index 8b800cbfec0557cde587367ff0fbe430fae1650b..a160e30b43c9982cc18b694ab722596214f23707 100644 (file)
@@ -48,14 +48,14 @@ query_state(Display *display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-       fprintf(stderr, "unable to find device %s\n", argv[0]);
+       fprintf(stderr, "unable to find device '%s'\n", argv[0]);
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
        return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-       fprintf(stderr, "unable to open device %s\n", argv[0]);
+       fprintf(stderr, "unable to open device '%s'\n", argv[0]);
        return 1;
     }
 
        return 1;
     }
 
index 4e2c2e670b7db1f7e1da128833d4d7ecc6260b50..97305c57015149d782dabbd91cfe747ea236334e 100644 (file)
@@ -54,7 +54,7 @@ register_events(Display               *dpy,
     device = XOpenDevice(dpy, info->id);
 
     if (!device) {
     device = XOpenDevice(dpy, info->id);
 
     if (!device) {
-       fprintf(stderr, "unable to open device %s\n", dev_name);
+       fprintf(stderr, "unable to open device '%s'\n", dev_name);
        return 0;
     }
 
        return 0;
     }
 
@@ -181,7 +181,7 @@ test(Display        *display,
        info = find_device_info(display, argv[idx], True);
 
        if (!info) {
        info = find_device_info(display, argv[idx], True);
 
        if (!info) {
-           fprintf(stderr, "unable to find device %s\n", argv[idx]);
+           fprintf(stderr, "unable to find device '%s'\n", argv[idx]);
            return EXIT_FAILURE;
        } else {
            if (register_events(display, info, argv[idx], handle_proximity)) {
            return EXIT_FAILURE;
        } else {
            if (register_events(display, info, argv[idx], handle_proximity)) {
index 6a31c83e599e15569212bdff8ae87e7c953a7395..7717ffbf10c812aab6eb83dbdd879df209bd960f 100644 (file)
@@ -246,7 +246,7 @@ map_to_output(Display *dpy, int argc, char *argv[], char *name, char *desc)
     info = xi2_find_device_info(dpy, argv[0]);
     if (!info)
     {
     info = xi2_find_device_info(dpy, argv[0]);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
         return EXIT_FAILURE;
     }
 
index 66b967bc1bb3ac76e3eaed02c91bbee48d1ed032..a336f53b61c9ef223f0860b46d570515ba48ce95 100644 (file)
@@ -240,7 +240,7 @@ find_device_info(Display    *display,
             (is_id && devices[loop].id == id))) {
            if (found) {
                fprintf(stderr,
             (is_id && devices[loop].id == id))) {
            if (found) {
                fprintf(stderr,
-                       "Warning: There are multiple devices named \"%s\".\n"
+                       "Warning: There are multiple devices named '%s'.\n"
                        "To ensure the correct one is selected, please use "
                        "the device ID instead.\n\n", name);
                return NULL;
                        "To ensure the correct one is selected, please use "
                        "the device ID instead.\n\n", name);
                return NULL;