Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[getopt] Accept "--" as an end-of-options marker
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
Marin Hannache authored and mcb30 committed Nov 2, 2011
1 parent a1f618c commit be90241
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/getopt.c
Expand Up @@ -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 ) )
Expand Down

0 comments on commit be90241

Please sign in to comment.