mirror of https://github.com/ipxe/ipxe.git
[getopt] Accept "--" as an end-of-options marker
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/5/head
parent
a1f618c625
commit
be90241ec2
|
@ -239,6 +239,11 @@ int getopt_long ( int argc, char * const argv[], const char *optstring,
|
||||||
|
|
||||||
/* Check for long options */
|
/* Check for long options */
|
||||||
if ( *(opttext++) == '-' ) {
|
if ( *(opttext++) == '-' ) {
|
||||||
|
/* "--" indicates end of options */
|
||||||
|
if ( *opttext == '\0' ) {
|
||||||
|
optind++;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
for ( longopt = longopts ; longopt->name ; longopt++ ) {
|
for ( longopt = longopts ; longopt->name ; longopt++ ) {
|
||||||
if ( ! match_long_option ( argc, argv, opttext,
|
if ( ! match_long_option ( argc, argv, opttext,
|
||||||
longopt, &option ) )
|
longopt, &option ) )
|
||||||
|
|
Loading…
Reference in New Issue