@@ -2062,6 +2062,12 @@ int main(int argc, char **argv) /* {{{ */
20622062 php_request_shutdown (NULL );
20632063 } zend_end_try ();
20642064
2065+ if (PHPDBG_G (exec ) && !memcmp ("-" , PHPDBG_G (exec ), 2 )) { /* i.e. execution context has been read from stdin - back it up */
2066+ phpdbg_file_source * data = zend_hash_str_find_ptr (& PHPDBG_G (file_sources ), PHPDBG_G (exec ), PHPDBG_G (exec_len ));
2067+ backup_phpdbg_compile = zend_string_alloc (data -> len + 2 , 1 );
2068+ sprintf (ZSTR_VAL (backup_phpdbg_compile ), "?>%.*s" , (int ) data -> len , data -> buf );
2069+ }
2070+
20652071 /* backup globals when cleaning */
20662072 if ((cleaning > 0 || remote ) && !quit_immediately ) {
20672073 settings = calloc (1 , sizeof (zend_phpdbg_globals ));
@@ -2114,12 +2120,6 @@ int main(int argc, char **argv) /* {{{ */
21142120 wrapper -> wops -> stream_opener = PHPDBG_G (orig_url_wrap_php );
21152121 }
21162122
2117- if (PHPDBG_G (exec ) && !memcmp ("-" , PHPDBG_G (exec ), 2 )) { /* i.e. execution context has been read from stdin - back it up */
2118- phpdbg_file_source * data = zend_hash_str_find_ptr (& PHPDBG_G (file_sources ), PHPDBG_G (exec ), PHPDBG_G (exec_len ));
2119- backup_phpdbg_compile = zend_string_alloc (data -> len + 2 , 1 );
2120- sprintf (ZSTR_VAL (backup_phpdbg_compile ), "?>%.*s" , (int ) data -> len , data -> buf );
2121- }
2122-
21232123 zend_try {
21242124 php_module_shutdown ();
21252125 } zend_end_try ();
0 commit comments