Easy enough to accept the syntax documented in the man page, so accept
the -I flag with or without a space between -I and the directory argument.

https://bugs.freedesktop.org/show_bug.cgi?id=34117

Signed-off-by: Alan Coopersmith <[email protected]>
---
 setxkbmap.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/setxkbmap.c b/setxkbmap.c
index e812a9c..868b727 100644
--- a/setxkbmap.c
+++ b/setxkbmap.c
@@ -414,7 +414,16 @@ parseArgs(int argc, char **argv)
             usage(argc, argv);
             exit(0);
         }
-        else if (strpfx(argv[i], "-I"))
+        else if (streq(argv[i], "-I")) /* space between -I and path */
+        {
+            if ( ++i < argc ) {
+                ok = addToList(&szInclPath, &numInclPath, &inclPath, argv[i]);
+            } else {
+                ERR("Error!   Option \"-I\" requires an argument\n");
+                ok = False;
+            }
+        }
+        else if (strpfx(argv[i], "-I")) /* no space between -I and path */
             ok = addToList(&szInclPath, &numInclPath, &inclPath, &argv[i][2]);
         else if (streq(argv[i], "-keycodes"))
             ok = setOptString(&i, argc, argv, KEYCODES_NDX, FROM_CMD_LINE);
-- 
1.7.3.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to