summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-03-21 23:19:00 +0000
committerMarcus Boerger <helly@php.net>2007-03-21 23:19:00 +0000
commit4d5ac8e9cf28c0d387232b8031d2e13c3b0c048d (patch)
tree91392a77216d8c8995b5fb1fee08fe072de95b10
parente53980587f49767324e7f11911729264c9aa52e8 (diff)
downloadphp-git-4d5ac8e9cf28c0d387232b8031d2e13c3b0c048d.tar.gz
- Fix issue with long form of command line switches
-rw-r--r--sapi/cli/getopt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sapi/cli/getopt.c b/sapi/cli/getopt.c
index 75ec1fa8d9..8634003dae 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) {