diff options
| author | Marcus Boerger <helly@php.net> | 2007-03-21 23:20:30 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2007-03-21 23:20:30 +0000 |
| commit | fe9f85f82076e161969a6e41916f15bc3fc286bb (patch) | |
| tree | 413094e527902e1b116c4990971d11760906314c /sapi/cli/getopt.c | |
| parent | c6d4c0c85a39252f308dfafa0a13a48fdf289620 (diff) | |
| download | php-git-fe9f85f82076e161969a6e41916f15bc3fc286bb.tar.gz | |
- MFH Fix issue with long form of command line switches
Diffstat (limited to 'sapi/cli/getopt.c')
| -rw-r--r-- | sapi/cli/getopt.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c index 0a88f2daf9..dd44703803 100644 --- a/sapi/cli/getopt.c +++ b/sapi/cli/getopt.c @@ -89,19 +89,19 @@ int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **opta } } optchr = 0; - dash = 1; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } - if (!dash) { - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + arg_start = 2 + strlen(opts[opts_idx].opt_name); + } else { + if (!dash) { + dash = 1; + optchr = 1; + } + /* Check if the guy tries to do a -: kind of flag */ + if (argv[*optind][optchr] == ':') { + dash = 0; + (*optind)++; + return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + } } if (opts_idx < 0) { while (1) { |
