This commit is contained in:
krakjoe 2013-11-20 12:51:57 +00:00
commit 38679621bb
3 changed files with 13 additions and 14 deletions

View File

@ -118,7 +118,7 @@ void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */
} /* }}} */
phpdbg_input_t** phpdbg_read_argv(char *buffer, int *argc TSRMLS_DC) /* {{{ */
phpdbg_input_t **phpdbg_read_argv(char *buffer, int *argc TSRMLS_DC) /* {{{ */
{
char *p;
char b[PHPDBG_MAX_CMD];

View File

@ -43,12 +43,11 @@ typedef enum {
typedef struct _phpdbg_input_t phpdbg_input_t;
struct _phpdbg_input_t {
char* const* start;
char *string;
size_t length;
char * const *start;
char *string;
size_t length;
phpdbg_input_t **argv;
int argc;
int argc;
};
typedef struct _phpdbg_param {
@ -67,7 +66,7 @@ typedef struct _phpdbg_param {
size_t len;
} phpdbg_param_t;
typedef int (*phpdbg_command_handler_t)(phpdbg_param_t *param TSRMLS_DC);
typedef int (*phpdbg_command_handler_t)(phpdbg_param_t* TSRMLS_DC);
struct _phpdbg_command_t {
const char *name; /* Command name */

View File

@ -153,7 +153,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
}
goto next_line;
}
{
phpdbg_input_t *input = phpdbg_read_input(cmd TSRMLS_CC);
switch (phpdbg_do_cmd(phpdbg_prompt_commands, input TSRMLS_CC)) {
@ -164,7 +164,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
}
phpdbg_destroy_input(&input TSRMLS_CC);
}
}
next_line:
line++;
@ -920,10 +920,10 @@ static PHPDBG_COMMAND(list) /* {{{ */
int phpdbg_call_register(phpdbg_input_t *input TSRMLS_DC) /* {{{ */
{
phpdbg_input_t *function = input->argv[0];
if (zend_hash_exists(
&PHPDBG_G(registered), function->string, function->length+1)) {
zval fname, *fretval;
zend_fcall_info *fci = emalloc(sizeof(zend_fcall_info));
@ -971,9 +971,9 @@ int phpdbg_call_register(phpdbg_input_t *input TSRMLS_DC) /* {{{ */
fretval, 0 TSRMLS_CC);
phpdbg_writeln(EMPTY);
}
zval_dtor(&fname);
if (fci->params) {
efree(fci->params);
}
@ -990,7 +990,7 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
{
int ret = SUCCESS;
phpdbg_input_t* input = phpdbg_read_input(NULL TSRMLS_CC);
phpdbg_input_t *input = phpdbg_read_input(NULL TSRMLS_CC);
if (input && input->length > 0L) {
do {