david/ipxe
Archived
1
0

[getopt] Accept "--" as an end-of-options marker

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Marin Hannache 2011-11-02 00:22:00 +00:00 committed by Michael Brown
parent a1f618c625
commit be90241ec2

View File

@ -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 ) )