diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2016-12-06 18:27:31 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2016-12-06 18:29:48 +0100 |
commit | 7e12b5da712f603d4ff68c378c0b1f06dcc495db (patch) | |
tree | cb21968cf076a7b6f6fbbcb2e9ee8428bc9da992 /sapi/phpdbg/phpdbg_list.c | |
parent | fee5c049a8190289ddbb39c71f2422031d0d12e3 (diff) | |
download | php-git-7e12b5da712f603d4ff68c378c0b1f06dcc495db.tar.gz |
Fixed issue getting executable lines from custom wrappers
See also krakjoe/phpdbg#161
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index b0bb157f08..1b70039fda 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -235,15 +235,16 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { phpdbg_file_source data, *dataptr; zend_file_handle fake; zend_op_array *ret; - char *filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + char *filename; uint line; char *bufptr, *endptr; - char resolved_path_buf[MAXPATHLEN]; if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) { return PHPDBG_G(compile_file)(file, type); } + filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1); if (data.len > 0) { memcpy(data.buf, bufptr, data.len); @@ -261,9 +262,6 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { fake.opened_path = file->opened_path; *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data; - if (VCWD_REALPATH(filename, resolved_path_buf)) { - filename = resolved_path_buf; - } for (line = 0, bufptr = data.buf - 1, endptr = data.buf + data.len; ++bufptr < endptr;) { if (*bufptr == '\n') { @@ -323,6 +321,8 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) { return NULL; } + filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + dataptr = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), filename, strlen(filename)); ZEND_ASSERT(dataptr != NULL); |