com php-src: another patch from upstream: phpdbg_cmd.c
| From: | Bob Weinand | Date: | Sun, 02 Feb 2014 14:58:39 +0000 |
| Subject: | com php-src: another patch from upstream: phpdbg_cmd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82814@lists.php.net to get a copy of this message | ||
Commit: d260b5d2401a84c591ff0ded4e9d85afe06919c3
Author: krakjoe <joe.watkins@live.co.uk> Sun, 2 Feb 2014 14:58:39 +0000
Parents: 395a936397992ea3ad70f3a4832be0a18716fb1f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d260b5d2401a84c591ff0ded4e9d85afe06919c3
Log:
another patch from upstream
Changed paths:
M phpdbg_cmd.c
Diff:
diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c
index c700851..1d78c53 100644
--- a/phpdbg_cmd.c
+++ b/phpdbg_cmd.c
@@ -479,7 +479,7 @@ disconnect:
#ifndef HAVE_LIBREADLINE
if (!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) {
- if (!phpdbg_write(phpdbg_get_prompt(TSRMLS_C))) {
+ if (!phpdbg_write("%s", phpdbg_get_prompt(TSRMLS_C))) {
goto disconnect;
}
}
@@ -595,6 +595,8 @@ PHPDBG_API int phpdbg_do_cmd(const phpdbg_command_t *command, phpdbg_input_t *in
(command->alias == *input->argv[0]->string))) {
phpdbg_param_t param;
+ phpdbg_command_t *initial_last_cmd;
+ phpdbg_param_t initial_last_param;
param..type = EMPTY_PARAM;
@@ -657,15 +659,20 @@ PHPDBG_API int phpdbg_do_cmd(const phpdbg_command_t *command, phpdbg_input_t
*in
}
}
+ initial_last_param = PHPDBG_G(lparam);
+ initial_last_cmd = (phpdbg_command_t *)PHPDBG_G(lcmd);
+ PHPDBG_G(lparam) = param;
+ PHPDBG_G(lcmd) = (phpdbg_command_t *)command;
+
rc = command->handler(¶m, input TSRMLS_CC);
/* only set last command when it is worth it! */
- if ((rc != FAILURE) &&
- !(PHPDBG_G(flags) & PHPDBG_IS_INITIALIZING)) {
- PHPDBG_G(lcmd) = (phpdbg_command_t*) command;
- phpdbg_clear_param(
- &PHPDBG_G(lparam) TSRMLS_CC);
- PHPDBG_G(lparam) = param;
+ if (rc != FAILURE && !(PHPDBG_G(flags) & PHPDBG_IS_INITIALIZING)) {
+ phpdbg_clear_param(&initial_last_param TSRMLS_CC);
+ } else if (PHPDBG_G(lcmd) == command && !memcmp(&PHPDBG_G(lparam),&
initial_last_param, sizeof(phpdbg_param_t))) {
+ PHPDBG_G(lparam) = initial_last_param;
+ PHPDBG_G(lcmd) = initial_last_cmd;
+ phpdbg_clear_param(¶m TSRMLS_CC);
}
break;
}