diff --git a/src/core/getopt.c b/src/core/getopt.c index b67da0c1..8a0fa2d0 100644 --- a/src/core/getopt.c +++ b/src/core/getopt.c @@ -239,6 +239,11 @@ int getopt_long ( int argc, char * const argv[], const char *optstring, /* Check for long options */ if ( *(opttext++) == '-' ) { + /* "--" indicates end of options */ + if ( *opttext == '\0' ) { + optind++; + return -1; + } for ( longopt = longopts ; longopt->name ; longopt++ ) { if ( ! match_long_option ( argc, argv, opttext, longopt, &option ) )