diff options
author | bjasspa <bjasspa@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-08-12 20:41:40 +0000 |
---|---|---|
committer | bjasspa <bjasspa@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-08-12 20:41:40 +0000 |
commit | 4e64c61fda7344a2b7f555ff57d1423b4092e35c (patch) | |
tree | 00febf4603dd69917128f4eedb16de67cc804092 /navit/support | |
parent | acaa5022d4543a23d8967b81a721d3bdbe08bf13 (diff) | |
download | navit-svn-4e64c61fda7344a2b7f555ff57d1423b4092e35c.tar.gz |
Fixed incompatibility with xgetopt which does not initialise optind to 1
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5199 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support')
-rw-r--r-- | navit/support/xgetopt/getopt_long.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/navit/support/xgetopt/getopt_long.c b/navit/support/xgetopt/getopt_long.c index 6da84590..b5cce831 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) |