diff options
author | krakjoe <joe.watkins@live.co.uk> | 2014-04-13 08:06:42 +0100 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2014-04-13 08:06:42 +0100 |
commit | ef86b57f3b6745d5215e1316512c108f46df8668 (patch) | |
tree | 5a7c8cf1061c0977ae1c99bce2bc49437d24319c /phpdbg.c | |
parent | 2fde2ada50a00512490511349389d08ede9822f8 (diff) | |
parent | 3db29ee43960a4e164244a55b0e2a4b23a112e49 (diff) | |
download | php-git-ef86b57f3b6745d5215e1316512c108f46df8668.tar.gz |
Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer
Conflicts:
phpdbg_prompt.c
Diffstat (limited to 'phpdbg.c')
-rw-r--r-- | phpdbg.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1119,8 +1119,16 @@ phpdbg_main: phpdbg->ini_entries = ini_entries; if (phpdbg->startup(phpdbg) == SUCCESS) { - php_request_startup(TSRMLS_C); + int i; + SG(request_info).argc = argc - php_optind + 1; + SG(request_info).argv = emalloc(SG(request_info).argc * sizeof(char *)); + for (i = SG(request_info).argc; --i;) { + SG(request_info).argv[i] = estrdup(argv[php_optind - 1 + i]); + } + SG(request_info).argv[php_optind - 1] = exec?exec:""; + php_request_startup(TSRMLS_C); + /* do not install sigint handlers for remote consoles */ /* sending SIGINT then provides a decent way of shutting down the server */ #ifdef ZEND_SIGNALS @@ -1269,6 +1277,12 @@ phpdbg_out: } #endif + /* free argv */ + for (i = SG(request_info).argc; --i;) { + efree(SG(request_info).argv[i]); + } + efree(SG(request_info).argv); + #ifndef ZTS /* force cleanup of auto and core globals */ zend_hash_clean(CG(auto_globals)); |