diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-06-16 23:36:20 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-06-16 23:37:39 +0200 |
commit | 8c4807fe7a78d9a7e73b3943cac0647df641eb2d (patch) | |
tree | 0ce7b02c5bd03c240dd4a4796dce00b9c05da598 /sapi/phpdbg/phpdbg.c | |
parent | fb346c8f9376d4a0be80e242406c1bb8dbf710f0 (diff) | |
download | php-git-8c4807fe7a78d9a7e73b3943cac0647df641eb2d.tar.gz |
Fix infinite loop when running phpdbg via -r(r)
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index eb8369b86f..7b7ed177df 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1021,6 +1021,7 @@ int main(int argc, char **argv) /* {{{ */ char *php_optarg; int php_optind, opt, show_banner = 1; long cleaning = -1; + zend_bool quit_immediately = 0; zend_bool remote = 0; int step = 0; zend_phpdbg_globals *settings = NULL; @@ -1086,7 +1087,9 @@ phpdbg_main: while ((opt = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { switch (opt) { case 'r': - phpdbg_startup_run++; + if (settings == NULL) { + phpdbg_startup_run++; + } break; case 'n': ini_ignore = 1; @@ -1545,7 +1548,7 @@ phpdbg_interact: do { zend_try { if (phpdbg_startup_run) { - zend_bool quit_immediately = phpdbg_startup_run > 1; + quit_immediately = phpdbg_startup_run > 1; phpdbg_startup_run = 0; PHPDBG_COMMAND_HANDLER(run)(NULL); if (quit_immediately) { @@ -1691,7 +1694,7 @@ phpdbg_out: } - if (cleaning > 0 || remote) { + if ((cleaning > 0 || remote) && !quit_immediately) { goto phpdbg_main; } |