summaryrefslogtreecommitdiff
path: root/navit/support
diff options
context:
space:
mode:
Diffstat (limited to 'navit/support')
-rw-r--r--navit/support/xgetopt/getopt_long.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/navit/support/xgetopt/getopt_long.c b/navit/support/xgetopt/getopt_long.c
index 6da84590d..b5cce831c 100644
--- a/navit/support/xgetopt/getopt_long.c
+++ b/navit/support/xgetopt/getopt_long.c
@@ -64,7 +64,11 @@ getopt_long(int argc, char *const argv[],
{
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */
-
+
+ /* getopt initialises optind to 1, but XGetopt defines it as 0 which breaks getopt_long */
+ if(optind == 0)
+ optind=1;
+
if (!*place)
{ /* update scanning pointer */
if (optind >= argc)