summaryrefslogtreecommitdiff
path: root/phpdbg_list.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2013-11-25 20:33:52 +0100
committerBob Weinand <bobwei9@hotmail.com>2013-11-25 20:33:52 +0100
commit2be5a1e3da05caee88bc92f2abec223cc999c1f0 (patch)
tree80ef72becc6d224f3334c3e08182351e77e24d1a /phpdbg_list.c
parent6932eb76e3631e5e8e12e1545d152a3b8567297c (diff)
downloadphp-git-2be5a1e3da05caee88bc92f2abec223cc999c1f0.tar.gz
Enable backwards reading in list command
Diffstat (limited to 'phpdbg_list.c')
-rw-r--r--phpdbg_list.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/phpdbg_list.c b/phpdbg_list.c
index 14ca56c1c3..05231bcf97 100644
--- a/phpdbg_list.c
+++ b/phpdbg_list.c
@@ -42,8 +42,9 @@ PHPDBG_LIST(lines) /* {{{ */
case NUMERIC_PARAM:
case EMPTY_PARAM:
phpdbg_list_file(phpdbg_current_file(TSRMLS_C),
- param->type == EMPTY_PARAM ? 0 : param->num,
- zend_get_executed_lineno(TSRMLS_C), 0 TSRMLS_CC);
+ param->type == EMPTY_PARAM ? 0 : (param->num < 0 ? 1 - param->num : param->num),
+ (param->type != EMPTY_PARAM && param->num < 0 ? param->num : 0) + zend_get_executed_lineno(TSRMLS_C),
+ 0 TSRMLS_CC);
break;
case FILE_PARAM:
phpdbg_list_file(param->file.name, param->file.line, 0, 0 TSRMLS_CC);