upload tizen2.0 source
[framework/uifw/xorg/util/x11-xkb-utils.git] / xkbcomp / xkbcomp.c
index b0df920..063ae87 100644 (file)
@@ -119,6 +119,7 @@ Usage(int argc, char *argv[])
         M1("Usage: %s [options] file[(map)] ...\n", argv[0]);
     M("Legal options:\n");
     M("-?,-help             Print this message\n");
+    M("-version             Print the version number\n");
     if (!xkblist)
     {
         M("-a                   Show all actions\n");
@@ -252,7 +253,11 @@ parseArgs(int argc, char *argv[])
             Usage(argc, argv);
             exit(0);
         }
-        else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
+        else if (strcmp(argv[i], "-version") == 0)
+        {
+            printf("xkbcomp %s\n", PACKAGE_VERSION);
+            exit(0);
+        } else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
         {
             showImplicit = True;
         }
@@ -648,25 +653,25 @@ parseArgs(int argc, char *argv[])
         len = strlen(inputFile);
         if (inputFile[len - 1] == ')')
         {
-            char *tmp;
-            if ((tmp = strchr(inputFile, '(')) != NULL)
+            char *tmpstr;
+            if ((tmpstr = strchr(inputFile, '(')) != NULL)
             {
-                *tmp = '\0';
+                *tmpstr = '\0';
                 inputFile[len - 1] = '\0';
-                tmp++;
-                if (*tmp == '\0')
+                tmpstr++;
+                if (*tmpstr == '\0')
                 {
                     WARN("Empty map in filename\n");
                     ACTION("Ignored\n");
                 }
                 else if (inputMap == NULL)
                 {
-                    inputMap = uStringDup(tmp);
+                    inputMap = uStringDup(tmpstr);
                 }
                 else
                 {
                     WARN("Map specified in filename and with -m flag\n");
-                    ACTION1("map from name (\"%s\") ignored\n", tmp);
+                    ACTION1("map from name (\"%s\") ignored\n", tmpstr);
                 }
             }
             else
@@ -1037,6 +1042,7 @@ main(int argc, char *argv[])
                 ok = False;
                 break;
             }
+            result.xkb->device_spec = device_id;
         }
         else if (inputFormat == INPUT_XKM) /* parse xkm file */
         {
@@ -1053,6 +1059,7 @@ main(int argc, char *argv[])
                 ERROR1("Cannot read XKM file \"%s\"\n", inputFile);
                 ok = False;
             }
+            result.xkb->device_spec = device_id;
         }
         else
         {