summaryrefslogtreecommitdiff
path: root/phpdbg_cmd.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2014-04-21 21:43:19 +0100
committerkrakjoe <joe.watkins@live.co.uk>2014-04-21 21:43:19 +0100
commite9668d4ce8512838d92b05aa47da02c85a37c486 (patch)
tree8606a87e638c3cf81dec31fb148e124ed30c8dd3 /phpdbg_cmd.c
parentbb0f0347dd99d42be923d5f61bc13e86df7cb8d4 (diff)
downloadphp-git-e9668d4ce8512838d92b05aa47da02c85a37c486.tar.gz
buffer input to repeat commands
Diffstat (limited to 'phpdbg_cmd.c')
-rw-r--r--phpdbg_cmd.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c
index ce66ba39ec..d4ce8ebc55 100644
--- a/phpdbg_cmd.c
+++ b/phpdbg_cmd.c
@@ -858,6 +858,27 @@ readline:
#endif
}
+ if (buffer && isspace(*buffer)) {
+ char *trimmed = buffer;
+ while (isspace(*trimmed))
+ trimmed++;
+
+ trimmed = estrdup(trimmed);
+ efree(buffer);
+ buffer = trimmed;
+ }
+
+ if (buffer && strlen(buffer)) {
+ if (PHPDBG_G(buffer)) {
+ efree(PHPDBG_G(buffer));
+ }
+ PHPDBG_G(buffer) = estrdup(buffer);
+ } else {
+ if (PHPDBG_G(buffer)) {
+ buffer = estrdup(PHPDBG_G(buffer));
+ }
+ }
+
return buffer;
} /* }}} */