]> granicus.if.org Git - php/commitdiff
Fix issues with path names and cwd
authorBob Weinand <bobwei9@hotmail.com>
Sat, 4 Oct 2014 21:30:57 +0000 (23:30 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Sat, 4 Oct 2014 21:30:57 +0000 (23:30 +0200)
phpdbg_list.c
phpdbg_print.c
phpdbg_prompt.c

index 5757d33ddad98ca783c1d1454378350573fca1b4..96eacd47665c18048b8f40c0335e170bb08b72cf 100644 (file)
@@ -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;
index e2b4dd229cb89214d8dd61071eeea7de9203f670..594fc9a052b9e13847219c80f8a47a814bcddd82 100644 (file)
@@ -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);
index a993c6c8293ee06ffeb41418b74f21f30415ab39..0abb75ae85b868f0fe7c092ddac29c9a77cb6cea 100644 (file)
@@ -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);