cvs: php-src /sapi/cli getopt.c
| From: | Marcus Boerger | Date: | Wed, 21 Mar 2007 23:19:00 +0000 |
| Subject: | cvs: php-src /sapi/cli getopt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43605@lists.php.net to get a copy of this message | ||
helly Wed Mar 21 23:19:00 2007 UTC
Modified files:
/php-src/sapi/cli getopt.c
Log:
- Fix issue with long form of command line switches
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/getopt.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/sapi/cli/getopt.c
diff -u php-src/sapi/cli/getopt.c:1.10 php-src/sapi/cli/getopt.c:1.11
--- php-src/sapi/cli/getopt.c:1.10 Mon Jan 1 09:29:36 2007
+++ php-src/sapi/cli/getopt.c Wed Mar 21 23:19:00 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: getopt.c,v 1.10 2007/01/01 09:29:36 sebastian Exp $ */
+/* $Id: getopt.c,v 1.11 2007/03/21 23:19:00 helly Exp $ */
#include <stdio.h>
#include <string.h>
@@ -89,19 +89,19 @@
}
}
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) {