From: Peter Hutterer Date: Thu, 20 Dec 2007 01:15:11 +0000 (+1030) Subject: Support GNU style options the dodgy way. X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/2a67ff9098efa0e1d53388816a0344067a3c21be?ds=inline;hp=--cc Support GNU style options the dodgy way. Simply removing all preceding "-" from the function name before running the usual comparison. --- 2a67ff9098efa0e1d53388816a0344067a3c21be diff --git a/src/xinput.c b/src/xinput.c index 5010923..8275d18 100644 --- a/src/xinput.c +++ b/src/xinput.c @@ -156,6 +156,7 @@ main(int argc, char * argv[]) { Display *display; entry *driver = drivers; + char *func; if (argc < 2) { usage(); @@ -169,13 +170,16 @@ main(int argc, char * argv[]) return EXIT_FAILURE; } + func = argv[1]; + while((*func) == '-') func++; + if (!is_xinput_present(display)) { fprintf(stderr, "%s extension not available\n", INAME); return EXIT_FAILURE; } while(driver->func_name) { - if (strcmp(driver->func_name, argv[1]) == 0) { + if (strcmp(driver->func_name, func) == 0) { int r = (*driver->func)(display, argc-2, argv+2, driver->func_name, driver->arg_desc); XFlush(display);