]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1'
authorBob Weinand <bobwei9@hotmail.com>
Wed, 21 Dec 2016 23:42:05 +0000 (00:42 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 21 Dec 2016 23:42:05 +0000 (00:42 +0100)
1  2 
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg_prompt.c

Simple merge
index 572e0a2ff7222bb0b6aa632f82ee7e19f99e1ad9,4655702fa88cb71be4cedecec95aab845d415a40..ce8945ac6ad53bb7034c8543068c3031e5086549
@@@ -536,22 -539,20 +536,20 @@@ int phpdbg_compile_stdin(zend_string *c
        if (PHPDBG_G(exec)) {
                efree(PHPDBG_G(exec));
        }
 -      PHPDBG_G(exec) = estrdup("-");
 -      PHPDBG_G(exec_len) = 1;
 +      PHPDBG_G(exec) = estrdup("Standard input code");
 +      PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
        { /* remove leading ?> from source */
                int i;
 -              zend_string *source_path = strpprintf(0, "-%c%p", 0, PHPDBG_G(ops)->opcodes);
+               /* remove trailing data after zero byte, used for avoiding conflicts in eval()'ed code snippets */
 +              zend_string *source_path = strpprintf(0, "Standard input code%c%p", 0, PHPDBG_G(ops)->opcodes);
                phpdbg_file_source *data = zend_hash_find_ptr(&PHPDBG_G(file_sources), source_path);
                dtor_func_t dtor = PHPDBG_G(file_sources).pDestructor;
                PHPDBG_G(file_sources).pDestructor = NULL;
                zend_hash_del(&PHPDBG_G(file_sources), source_path);
                PHPDBG_G(file_sources).pDestructor = dtor;
 -              zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "-", 1, data);
 +              zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "Standard input code", sizeof("Standard input code")-1, data);
                zend_string_release(source_path);
  
-               efree(data->filename);
-               data->filename = estrdup("Standard input code");
                for (i = 1; i <= data->lines; i++) {
                        data->line[i] -= 2;
                }