]> granicus.if.org Git - php/commitdiff
Do not convert args to Unicode in getopt(), they should stay binary.
authorAndrei Zmievski <andrei@php.net>
Tue, 12 Dec 2006 18:24:16 +0000 (18:24 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 12 Dec 2006 18:24:16 +0000 (18:24 +0000)
ext/standard/basic_functions.c

index fe9451a68774e9ff07e5d865d7a5a209eff3492d..b9203f035a34d084e039f8eec5cff01464d4fbe5 100644 (file)
@@ -4497,7 +4497,7 @@ static void free_longopts(struct option *longopts)
 /* }}} */
 #endif
 
-/* {{{ proto array getopt(string options [, array longopts])
+/* {{{ proto array getopt(string options [, array longopts]) U
    Get options from the command line argument list */
 PHP_FUNCTION(getopt)
 {
@@ -4634,7 +4634,8 @@ PHP_FUNCTION(getopt)
 
                MAKE_STD_ZVAL(val);
                if (optarg != NULL) {
-                       ZVAL_RT_STRING(val, optarg, 1);
+                       /* keep the arg as binary, since the encoding is not known */
+                       ZVAL_STRING(val, optarg, 1);
                } else {
                        ZVAL_FALSE(val);
                }