com php-src: ...: phpdbg_prompt.c
| From: | Bob Weinand | Date: | Wed, 13 Nov 2013 04:34:02 +0000 |
| Subject: | com php-src: ...: phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75029@lists.php.net to get a copy of this message | ||
Commit: 63a0c1ca15f695f648dbed477e8c0dda8c85fdb7
Author: krakjoe <joe.watkins@live.co.uk> Wed, 13 Nov 2013 04:34:02 +0000
Parents: a6d08af06b8ee4e9b3f6486fb2da7cfc69472965
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=63a0c1ca15f695f648dbed477e8c0dda8c85fdb7
Log:
..
Changed paths:
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 951fe1d..012fdd7 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt..c
@@ -563,7 +563,7 @@ phpdbg_interactive_enter:
#endif
/* trim space from end of input */
- while (isspace(cmd[cmd_len-1]))
+ while (*cmd && isspace(cmd[cmd_len-1]))
cmd_len--;
/* ensure string is null terminated */
@@ -588,21 +588,29 @@ phpdbg_interactive_enter:
return PHPDBG_NEXT;
}
}
- } else if (PHPDBG_G(last)) {
- PHPDBG_G(last)->handler(
- PHPDBG_G(last_params), PHPDBG_G(last_params_len) TSRMLS_CC);
- }
-
- if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
+
#ifdef HAVE_LIBREADLINE
if (cmd) {
free(cmd);
cmd = NULL;
}
#endif
+
+ } else if (PHPDBG_G(last)) {
+ PHPDBG_G(last)->handler(
+ PHPDBG_G(last_params), PHPDBG_G(last_params_len) TSRMLS_CC);
+ }
+
+ if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
goto phpdbg_interactive_enter;
}
}
+
+#ifdef HAVE_LIBREADLINE
+ if (cmd) {
+ free(cmd);
+ }
+#endif
return SUCCESS;
} /* }}} */