com php-src: - Removed unnecessary check and allocation: phpdbg_cmd.c

From: Date: Tue, 19 Nov 2013 22:13:51 +0000
Subject: com php-src: - Removed unnecessary check and allocation: phpdbg_cmd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74784@lists.php.net to get a copy of this message
Commit: a1adc8124e903f26f51ef8f69b37dc8e1d4c5a52 Author: Felipe Pena <felipensp@gmail.com> Tue, 19 Nov 2013 20:13:51 -0200 Parents: bc278c7013af4d3533629d1f825eecc75948702b Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a1adc8124e903f26f51ef8f69b37dc8e1d4c5a52 Log: - Removed unnecessary check and allocation Changed paths: M phpdbg_cmd.c Diff: diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index db7774d..d1767b0 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -247,29 +247,23 @@ phpdbg_input_t *phpdbg_read_input(TSRMLS_D) /* {{{ */ buffer->string = phpdbg_trim(cmd, strlen(cmd), &buffer->length); - if (buffer->string) { - /* temporary, when we switch to argv/argc handling - will be unnecessary */ - char *store = (char*) estrdup(buffer->string); + /* store constant pointer to start of buffer */ + buffer->start = (char* const*) buffer->string; - /* store constant pointer to start of buffer */ - buffer->start = (char* const*) buffer->string; + buffer->argv = phpdbg_read_argv( + buffer->string, &buffer->argc TSRMLS_CC); - buffer->argv = phpdbg_read_argv( - store, &buffer->argc TSRMLS_CC); +#ifdef PHPDBG_DEBUG + if (buffer->argc) { + int arg = 0; - if (buffer->argc) { - int arg = 0; - - while (arg < buffer->argc) { - phpdbg_debug( - "argv %d=%s", arg, buffer->argv[arg]->string); - arg++; - } + while (arg < buffer->argc) { + phpdbg_debug( + "argv %d=%s", arg, buffer->argv[arg]->string); + arg++; } - - efree(store); } +#endif #ifdef HAVE_LIBREADLINE if (cmd) {

« previous php.cvs (#74784) next »