diff options
Diffstat (limited to 'sys/contrib/dev/acpica/common/getopt.c')
-rw-r--r-- | sys/contrib/dev/acpica/common/getopt.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c index a4ad288..69f2ed5 100644 --- a/sys/contrib/dev/acpica/common/getopt.c +++ b/sys/contrib/dev/acpica/common/getopt.c @@ -197,6 +197,26 @@ AcpiGetopt( CurrentCharPtr = 1; } + /* Option has an optional argument? */ + + else if (*OptsPtr == '+') + { + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') + { + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; + } + else if (++AcpiGbl_Optind >= argc) + { + AcpiGbl_Optarg = NULL; + } + else + { + AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; + } + + CurrentCharPtr = 1; + } + /* Option has optional single-char arguments? */ else if (*OptsPtr == '^') |