helly           Sun Apr 22 15:31:16 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/sapi/cli/tests     003-2.phpt 

  Modified files:              
    /php-src/sapi/cgi   getopt.c 
    /php-src/sapi/cli   getopt.c 
  Log:
  - MFH getopt fixes
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/getopt.c?r1=1.9.2.1.2.2&r2=1.9.2.1.2.3&diff_format=u
Index: php-src/sapi/cgi/getopt.c
diff -u php-src/sapi/cgi/getopt.c:1.9.2.1.2.2 
php-src/sapi/cgi/getopt.c:1.9.2.1.2.3
--- php-src/sapi/cgi/getopt.c:1.9.2.1.2.2       Sun Apr 15 22:50:58 2007
+++ php-src/sapi/cgi/getopt.c   Sun Apr 22 15:31:16 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: getopt.c,v 1.9.2.1.2.2 2007/04/15 22:50:58 sniper Exp $ */
+/* $Id: getopt.c,v 1.9.2.1.2.3 2007/04/22 15:31:16 helly Exp $ */
 
 #include <stdio.h>
 #include <string.h>
@@ -107,6 +107,7 @@
                        (*optind)++;
                        return (php_opt_error(argc, argv, *optind-1, optchr, 
OPTERRCOLON, show_err));
                }
+               arg_start = 1 + optchr;
        }
        if (opts_idx < 0) {
                while (1) {
@@ -120,6 +121,7 @@
                                        (*optind)++;
                                } else {
                                        optchr++;
+                                       arg_start++;
                                }
                                return(php_opt_error(argc, argv, errind, 
errchr, OPTERRNF, show_err));
                        } else if (argv[*optind][optchr] == 
opts[opts_idx].opt_char) {
@@ -143,7 +145,7 @@
                }
                return opts[opts_idx].opt_char;
        } else {
-               if (arg_start == 2) {
+               if (arg_start >= 2) {
                        if (!argv[*optind][optchr+1])
                        {
                                dash = 0;
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/getopt.c?r1=1.8.2.1.2.3&r2=1.8.2.1.2.4&diff_format=u
Index: php-src/sapi/cli/getopt.c
diff -u php-src/sapi/cli/getopt.c:1.8.2.1.2.3 
php-src/sapi/cli/getopt.c:1.8.2.1.2.4
--- php-src/sapi/cli/getopt.c:1.8.2.1.2.3       Thu Mar 22 21:35:41 2007
+++ php-src/sapi/cli/getopt.c   Sun Apr 22 15:31:16 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: getopt.c,v 1.8.2.1.2.3 2007/03/22 21:35:41 johannes Exp $ */
+/* $Id: getopt.c,v 1.8.2.1.2.4 2007/04/22 15:31:16 helly Exp $ */
 
 #include <stdio.h>
 #include <string.h>
@@ -107,6 +107,7 @@
                        (*optind)++;
                        return (php_opt_error(argc, argv, *optind-1, optchr, 
OPTERRCOLON, show_err));
                }
+               arg_start = 1 + optchr;
        }
        if (opts_idx < 0) {
                while (1) {
@@ -120,6 +121,7 @@
                                        (*optind)++;
                                } else {
                                        optchr++;
+                                       arg_start++;
                                }
                                return(php_opt_error(argc, argv, errind, 
errchr, OPTERRNF, show_err));
                        } else if (argv[*optind][optchr] == 
opts[opts_idx].opt_char) {
@@ -143,7 +145,7 @@
                }
                return opts[opts_idx].opt_char;
        } else {
-               if (arg_start == 2) {
+               if (arg_start >= 2) {
                        if (!argv[*optind][optchr+1])
                        {
                                dash = 0;

http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/003-2.phpt?view=markup&rev=1.1
Index: php-src/sapi/cli/tests/003-2.phpt
+++ php-src/sapi/cli/tests/003-2.phpt
--TEST--
defining INI options with -d (as 2nd arg)
--SKIPIF--
<?php 
include "skipif.inc"; 
if (substr(PHP_OS, 0, 3) == 'WIN') {
        die ("skip not for Windows");
}
?>
--FILE--
<?php

$php = getenv('TEST_PHP_EXECUTABLE');

var_dump(`"$php" -nd max_execution_time=111 -r 
'var_dump(ini_get("max_execution_time"));'`);
var_dump(`"$php" -nd max_execution_time=500 -r 
'var_dump(ini_get("max_execution_time"));'`);

?>
===DONE===
--EXPECTF--     
string(16) "string(3) "111"
"
string(16) "string(3) "500"
"
===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to