From: Bob Weinand Date: Sat, 4 Oct 2014 21:30:57 +0000 (+0200) Subject: Fix issues with path names and cwd X-Git-Tag: php-5.6.3RC1~51^2~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62465b6d821d3e074af06880d7d3e25fb7a9a038;p=php Fix issues with path names and cwd --- diff --git a/phpdbg_list.c b/phpdbg_list.c index 5757d33dda..96eacd4766 100644 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@ -246,6 +246,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { fake.free_filename = 0; fake.opened_path = NULL; fake.filename = filename; + fake.opened_path = file->opened_path; *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data; zend_hash_add(&PHPDBG_G(file_sources), filename, strlen(filename), &dataptr, sizeof(phpdbg_file_source *), NULL); @@ -260,6 +261,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { ret = PHPDBG_G(compile_file)(&fake, type TSRMLS_CC); + fake.opened_path = NULL; zend_file_handle_dtor(&fake TSRMLS_CC); return ret; diff --git a/phpdbg_print.c b/phpdbg_print.c index e2b4dd229c..594fc9a052 100644 --- a/phpdbg_print.c +++ b/phpdbg_print.c @@ -248,7 +248,7 @@ PHPDBG_PRINT(func) /* {{{ */ phpdbg_error("The function %s could not be found", func_name); } } phpdbg_catch_access { - phpdbg_error("Couldn't fetch function %.*s, invalid data source", func_name_len, func_name); + phpdbg_error("Couldn't fetch function %.*s, invalid data source", (int) func_name_len, func_name); } phpdbg_end_try_access(); efree(lcname); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index a993c6c829..0abb75ae85 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -351,7 +351,9 @@ PHPDBG_COMMAND(exec) /* {{{ */ PHPDBG_G(exec) = res; PHPDBG_G(exec_len) = res_len; - + + VCWD_CHDIR_FILE(res); + *SG(request_info).argv = PHPDBG_G(exec); php_hash_environment(TSRMLS_C);