summaryrefslogtreecommitdiff
path: root/phpdbg_cmd.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2014-02-21 21:31:01 +0000
committerkrakjoe <joe.watkins@live.co.uk>2014-02-21 21:31:01 +0000
commitee6cc5ba603cfc7204d090a7b93b1cd5094396f4 (patch)
tree318d6f7b2e212c7acb4598e9377889fd32c0d9ce /phpdbg_cmd.c
parente37144f44b4f5d7869f84a6ba1ed3891d07d0708 (diff)
downloadphp-git-ee6cc5ba603cfc7204d090a7b93b1cd5094396f4.tar.gz
do not allow abbreivation of anything without alias, fixes input for sh/ev
Diffstat (limited to 'phpdbg_cmd.c')
-rw-r--r--phpdbg_cmd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c
index 813911d9a3..814939758a 100644
--- a/phpdbg_cmd.c
+++ b/phpdbg_cmd.c
@@ -655,8 +655,14 @@ PHPDBG_API const phpdbg_command_t* phpdbg_stack_resolve(const phpdbg_command_t *
/* match full, case insensitive, command name */
if (strncasecmp(command->name, name->str, name->len) == SUCCESS) {
if (matches < 3) {
- matched[matches] = command;
- matches++;
+
+ /* only allow abbreviating commands that can be aliased */
+ if (((name->len != command->name_len) && command->alias) ||
+ (name->len == command->name_len)) {
+ matched[matches] = command;
+ matches++;
+ }
+
/* exact match */
if (name->len == command->name_len)
@@ -748,10 +754,10 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why) {
switch (top->type) {
case EVAL_PARAM:
- return PHPDBG_COMMAND_HANDLER(eval)(top TSRMLS_CC);
+ return PHPDBG_COMMAND_HANDLER(ev)(top TSRMLS_CC);
case SHELL_PARAM:
- return PHPDBG_COMMAND_HANDLER(shell)(top TSRMLS_CC);
+ return PHPDBG_COMMAND_HANDLER(sh)(top TSRMLS_CC);
case STR_PARAM: {
handler = phpdbg_stack_resolve(