com php-src: Fixed that for example "run" is only set as last cmd after the whole execution: phpdbg_cmd.c

From: Date: Sat, 18 Jan 2014 18:18:28 +0000
Subject: com php-src: Fixed that for example "run" is only set as last cmd after the whole execution: phpdbg_cmd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77096@lists.php.net to get a copy of this message
Commit: a1f592565254a991efe80a3f910733fbb29813fc Author: Bob Weinand <bobwei9@hotmail.com> Sat, 18 Jan 2014 13:18:28 -0500 Parents: 2712d7e2248ab91015502d648c9c65d8e5627e69 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a1f592565254a991efe80a3f910733fbb29813fc Log: Fixed that for example "run" is only set as last cmd after the whole execution Changed paths: M phpdbg_cmd.c Diff: diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 9f052d6..21e07c8 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -582,6 +582,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; @@ -644,15 +646,20 @@ PHPDBG_API int phpdbg_do_cmd(const phpdbg_command_t *command, phpdbg_input_t *in } } + PHPDBG_G(lparam) = param; + initial_last_param = PHPDBG_G(lparam); + initial_last_cmd = (phpdbg_command_t *)PHPDBG_G(lcmd); + PHPDBG_G(lcmd) = (phpdbg_command_t *)command; + rc = command->handler(&param, 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(&param TSRMLS_CC); } break; }

« previous php.cvs (#77096) next »