diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-07-26 18:20:00 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-07-26 18:20:00 +0000 |
commit | dbded195f9840f9044a6828c8877c6bf0a956482 (patch) | |
tree | e05da15a04629f6e36af5ca6c81a2efda47a9dc3 /source/common/getopt.c | |
parent | 94c37fb2483cc09856a30e74879a69f2ccfe22f0 (diff) |
Notes
Diffstat (limited to 'source/common/getopt.c')
-rw-r--r-- | source/common/getopt.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/common/getopt.c b/source/common/getopt.c index f1921ee2c2cb..4bcf3dbc2821 100644 --- a/source/common/getopt.c +++ b/source/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 == '^') |