From 1ac152938cfe40e98b7b3c8cf403abb113266cfa Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 3 Mar 2016 16:46:04 +0100 Subject: Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE Also re bug #71575. --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 907f629c01..92f1f64bf4 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -103,7 +103,7 @@ PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; #if defined(PHP_WIN32) && defined(ZTS) -ZEND_TSRMLS_CACHE_DEFINE(); +ZEND_TSRMLS_CACHE_DEFINE() #endif #ifndef O_BINARY -- cgit v1.2.1 From 68ebfc87ad4f3842cd680c32ab307344c8659ce3 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Sat, 12 Mar 2016 21:15:54 -0600 Subject: Fix bug #71624, PHP_MODE_PROCESS_STDIN (CLI SAPI called with '-R') did not properly set $argi and $argn --- sapi/cli/php_cli.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 92f1f64bf4..5d789d2626 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1018,16 +1018,15 @@ static int do_cli(int argc, char **argv) /* {{{ */ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1) == FAILURE) { exit_status=254; } - ZVAL_LONG(&argi, index); - zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); while (len > 0 && len-- && (input[len]=='\n' || input[len]=='\r')) { input[len] = '\0'; } - ZVAL_STRINGL(&argn, input, len); + ZVAL_STRINGL(&argn, input, len + 1); zend_hash_str_update(&EG(symbol_table), "argn", sizeof("argn")-1, &argn); - Z_LVAL(argi) = ++index; + ZVAL_LONG(&argi, ++index); + zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1) == FAILURE) { exit_status=254; -- cgit v1.2.1 From fa6ce55675c75140339393a0dec7cf5763b950db Mon Sep 17 00:00:00 2001 From: Matt Ficken Date: Mon, 21 Mar 2016 21:09:32 -0700 Subject: bug #71478 implementing feature request --- sapi/cli/php_cli.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 5d789d2626..6683f21393 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -689,6 +689,14 @@ static int do_cli(int argc, char **argv) /* {{{ */ #else "NTS " #endif +#ifdef COMPILER + COMPILER + " " +#endif +#ifdef ARCHITECTURE + ARCHITECTURE + " " +#endif #if ZEND_DEBUG "DEBUG " #endif -- cgit v1.2.1 From dbae1653daba7524f10642155c8c46a907970151 Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Fri, 29 Apr 2016 10:19:55 +0100 Subject: fix size_t signed comparison --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 5d789d2626..978c8b332e 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -304,7 +304,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */ if (cli_shell_callbacks.cli_shell_ub_write) { size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length); - if (ub_wrote > -1) { + if (ub_wrote != (size_t) -1) { return ub_wrote; } } -- cgit v1.2.1