summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_list.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-10-25 19:09:19 +0200
committerBob Weinand <bobwei9@hotmail.com>2014-10-25 19:09:19 +0200
commit044f37a832ec1f72c960b02dc7a5b9aca3f43f67 (patch)
treea910460a3bc2312bcf2aa6b81039396c6a46d0e7 /sapi/phpdbg/phpdbg_list.c
parent87c28ccd28121070ba7225f0ad73b9246dcfdc49 (diff)
parent24babb01946ccb63b993b98b161455475a697d42 (diff)
downloadphp-git-044f37a832ec1f72c960b02dc7a5b9aca3f43f67.tar.gz
Merge remote-tracking branch 'origin/PHP-5.6'
Conflicts: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_list.c
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r--sapi/phpdbg/phpdbg_list.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index de03a3651e..dd3db355fe 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -126,8 +126,16 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli
{
uint line, lastline;
phpdbg_file_source *data;
+ char resolved_path_buf[MAXPATHLEN];
+ const char *abspath;
- if (!(data = zend_hash_find_ptr(&PHPDBG_G(file_sources), filename))) {
+ if (VCWD_REALPATH(filename->val, resolved_path_buf)) {
+ abspath = resolved_path_buf;
+ } else {
+ abspath = filename->val;
+ }
+
+ if (!(data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), abspath, strlen(abspath)))) {
phpdbg_error("list", "type=\"unknownfile\"", "Could not find information about included file...");
return;
}
@@ -230,6 +238,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
char *filename = (char *)(file->opened_path ? file->opened_path : file->filename);
uint line;
char *bufptr, *endptr;
+ char resolved_path_buf[MAXPATHLEN];
zend_stream_fixup(file, &data.buf, &data.len TSRMLS_CC);
@@ -256,6 +265,9 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) {
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') {