]> diplodocus.org Git - xorg-xinput/commitdiff
If there's multiple null-terminated strings in the property, print all.
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Apr 2009 04:50:08 +0000 (14:50 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 30 Apr 2009 04:50:21 +0000 (14:50 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/property.c

index 9c5e86b..f30b01b 100644 (file)
@@ -74,9 +74,17 @@ print_property(Display *dpy, XDevice* dev, Atom property)
                     }
                     break;
                 case XA_STRING:
-                    printf("\"%s\"", ptr);
-                    done = True;
-                    break;
+                    {
+                        int len = 0;
+                        unsigned char *p = ptr;
+                        while(len < nitems)
+                        {
+                            printf("'%s' ", &p[len]);
+                            len += (strlen(&p[len]) + 1);
+                        }
+                        done = True;
+                        break;
+                    }
                 case XA_ATOM:
                     printf("\"%s\"", XGetAtomName(dpy, *(Atom*)ptr));
                     break;
@@ -95,10 +103,10 @@ print_property(Display *dpy, XDevice* dev, Atom property)
 
             ptr += act_format/8;
 
-            if (j < nitems - 1)
-                printf(", ");
             if (done == True)
                 break;
+            if (j < nitems - 1)
+                printf(", ");
         }
         printf("\n");
         XFree(data);