@@ -2040,6 +2040,12 @@ int main(int argc, char **argv) /* {{{ */
20402040 zend_objects_store_mark_destructed (& EG (objects_store ));
20412041 }
20422042
2043+ if (PHPDBG_G (exec ) && !memcmp ("-" , PHPDBG_G (exec ), 2 )) { /* i.e. execution context has been read from stdin - back it up */
2044+ phpdbg_file_source * data = zend_hash_str_find_ptr (& PHPDBG_G (file_sources ), PHPDBG_G (exec ), PHPDBG_G (exec_len ));
2045+ backup_phpdbg_compile = zend_string_alloc (data -> len + 2 , 1 );
2046+ sprintf (ZSTR_VAL (backup_phpdbg_compile ), "?>%.*s" , (int ) data -> len , data -> buf );
2047+ }
2048+
20432049 /* backup globals when cleaning */
20442050 if ((cleaning > 0 || remote ) && !quit_immediately ) {
20452051 settings = calloc (1 , sizeof (zend_phpdbg_globals ));
@@ -2099,12 +2105,6 @@ int main(int argc, char **argv) /* {{{ */
20992105 wrapper -> wops -> stream_opener = PHPDBG_G (orig_url_wrap_php );
21002106 }
21012107
2102- if (PHPDBG_G (exec ) && !memcmp ("-" , PHPDBG_G (exec ), 2 )) { /* i.e. execution context has been read from stdin - back it up */
2103- phpdbg_file_source * data = zend_hash_str_find_ptr (& PHPDBG_G (file_sources ), PHPDBG_G (exec ), PHPDBG_G (exec_len ));
2104- backup_phpdbg_compile = zend_string_alloc (data -> len + 2 , 1 );
2105- sprintf (ZSTR_VAL (backup_phpdbg_compile ), "?>%.*s" , (int ) data -> len , data -> buf );
2106- }
2107-
21082108 zend_try {
21092109 php_module_shutdown ();
21102110 } zend_end_try ();
0 commit comments