diff options
author | Anatol Belski <ab@php.net> | 2018-11-16 23:19:33 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-11-16 23:19:33 +0100 |
commit | a7e9790969952c0574d8708277abfd25d12f58e5 (patch) | |
tree | 076af5ec7afbcdfb6f93d4ca6d9511a1a9c12931 /sapi/cli/php_cli.c | |
parent | 211c6189f6921c17ec55a3b422ab5fa4bdd5e88f (diff) | |
download | php-git-a7e9790969952c0574d8708277abfd25d12f58e5.tar.gz |
Fixed bug #77111 php-win.exe corrupts unicode symbols from cli parameters
The binary can be of course used on console, for whatever reasons, so
UNICODE API should be used in that case. That might however not work as
expected, if the binary is used for a service.
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index b217b2731d..86d2c6d224 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -651,7 +651,7 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, /* }}} */ /*{{{ php_cli_win32_ctrl_handler */ -#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) +#if defined(PHP_WIN32) BOOL WINAPI php_cli_win32_ctrl_handler(DWORD sig) { (void)php_win32_cp_cli_do_restore(orig_cp); @@ -1204,12 +1204,11 @@ int main(int argc, char *argv[]) # ifdef PHP_CLI_WIN32_NO_CONSOLE int argc = __argc; char **argv = __argv; -# else +# endif int num_args; wchar_t **argv_wide; char **argv_save = argv; BOOL using_wide_argv = 0; -# endif #endif int c; @@ -1379,7 +1378,7 @@ exit_loop: } module_started = 1; -#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) +#if defined(PHP_WIN32) php_win32_cp_cli_setup(); orig_cp = (php_win32_cp_get_orig())->id; /* Ignore the delivered argv and argc, read from W API. This place @@ -1425,7 +1424,7 @@ out: tsrm_shutdown(); #endif -#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) +#if defined(PHP_WIN32) (void)php_win32_cp_cli_restore(); if (using_wide_argv) { |