diff options
author | Marin Hannache | 2011-11-02 01:22:00 +0100 |
---|---|---|
committer | Michael Brown | 2011-11-02 01:23:57 +0100 |
commit | be90241ec292ba561562827b2685d2881bc92b5e (patch) | |
tree | 47b9af7420bf2cfa279e01ff93915b545e0197f2 /src/core/getopt.c | |
parent | [undi] Use meaningful driver and device names (diff) | |
download | ipxe-be90241ec292ba561562827b2685d2881bc92b5e.tar.gz ipxe-be90241ec292ba561562827b2685d2881bc92b5e.tar.xz ipxe-be90241ec292ba561562827b2685d2881bc92b5e.zip |
[getopt] Accept "--" as an end-of-options marker
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/getopt.c')
-rw-r--r-- | src/core/getopt.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 ) ) |