diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-04-23 11:04:54 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-04-23 11:04:54 +0000 |
| commit | 83d74b7488caecc960dd056e702e28113c7a313d (patch) | |
| tree | da16f1e619bcbde6210c18e396c8ba0168cb24c5 | |
| parent | 1607e9fa79f6270345a320006fa79c1833ba6dc1 (diff) | |
| download | php-git-83d74b7488caecc960dd056e702e28113c7a313d.tar.gz | |
fix long options
| -rw-r--r-- | sapi/cgi/getopt.c | 3 | ||||
| -rw-r--r-- | sapi/cli/getopt.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sapi/cgi/getopt.c b/sapi/cgi/getopt.c index 0dd8a45f5b..4821a9c84d 100644 --- a/sapi/cgi/getopt.c +++ b/sapi/cgi/getopt.c @@ -145,7 +145,8 @@ int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **opta } return opts[opts_idx].opt_char; } else { - if (arg_start >= 2) { + /* multiple options specified as one (exclude long opts) */ + if (arg_start >= 2 && !((argv[*optind][0] == '-') && (argv[*optind][1] == '-'))) { if (!argv[*optind][optchr+1]) { dash = 0; diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c index 0dd8a45f5b..4821a9c84d 100644 --- a/sapi/cli/getopt.c +++ b/sapi/cli/getopt.c @@ -145,7 +145,8 @@ int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **opta } return opts[opts_idx].opt_char; } else { - if (arg_start >= 2) { + /* multiple options specified as one (exclude long opts) */ + if (arg_start >= 2 && !((argv[*optind][0] == '-') && (argv[*optind][1] == '-'))) { if (!argv[*optind][optchr+1]) { dash = 0; |
