summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-07-19 02:56:41 -0400
committerRan Benita <ran234@gmail.com>2019-07-19 09:56:41 +0300
commit32d178b50fe0da05e51e4fe8903c84371d133331 (patch)
treed22167f4a717891c371af52f83978fcd88f4ebaf
parent909cc04d2c635fe5763fbde21f807ef8fc9c0515 (diff)
downloadlibxkbcommon-32d178b50fe0da05e51e4fe8903c84371d133331.tar.gz
libxkbcommon-32d178b50fe0da05e51e4fe8903c84371d133331.tar.bz2
libxkbcommon-32d178b50fe0da05e51e4fe8903c84371d133331.zip
test/rmlvo-to-keymap.c: fix compilation on Darwin (#101)
program_invocation_short_name isn't portable.
-rw-r--r--test/rmlvo-to-keymap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/rmlvo-to-keymap.c b/test/rmlvo-to-keymap.c
index ed48e49..89f71a0 100644
--- a/test/rmlvo-to-keymap.c
+++ b/test/rmlvo-to-keymap.c
@@ -28,15 +28,16 @@
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include "xkbcommon/xkbcommon.h"
static bool print = false;
static void
-usage(void)
+usage(char **argv)
{
printf("Usage: %s [--print] [--rules <rules>] [--layout <layout>] [--variant <variant>] [--options <option>]\n",
- program_invocation_short_name);
+ basename(argv[0]));
printf("This tool tests the compilation from RMLVO to a keymap.\n");
printf("--print print the resulting keymap\n");
}
@@ -72,7 +73,7 @@ parse_options(int argc, char **argv, struct xkb_rule_names *names)
switch (c) {
case 'h':
- usage();
+ usage(argv);
exit(0);
case OPT_PRINT:
print = true;
@@ -93,7 +94,7 @@ parse_options(int argc, char **argv, struct xkb_rule_names *names)
names->options = optarg;
break;
default:
- usage();
+ usage(argv);
exit(1);
}
@@ -117,7 +118,7 @@ main(int argc, char **argv)
int rc;
if (argc <= 1) {
- usage();
+ usage(argv);
return 1;
}