com php-src: phpdbg standard input changes: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_prompt.c sapi/phpdbg/tests/stdin_0 01.phpt
| From: | Joe Watkins | Date: | Sun, 13 Nov 2016 08:00:15 +0000 |
| Subject: | com php-src: phpdbg standard input changes: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_prompt.c sapi/phpdbg/tests/stdin_0 01.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95746@lists.php.net to get a copy of this message | ||
Commit: 6c7e795c150c68785a543a4dc0db897f5a57dd16
Author: Joe Watkins <krakjoe@php.net> Sun, 13 Nov 2016 08:00:15 +0000
Parents: 5fbf56578731d5926b0e5b646614455416e99437
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c7e795c150c68785a543a4dc0db897f5a57dd16
Log:
phpdbg standard input changes
Changed paths:
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg_prompt.c
M sapi/phpdbg/tests/stdin_001.phpt
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index ce4529d..b0e9cae 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -2093,7 +2093,7 @@ phpdbg_out:
php_request_shutdown(NULL);
} zend_end_try();
- if (PHPDBG_G(exec) && !memcmp("-", PHPDBG_G(exec), 2)) { /* i.e. execution
context has been read from stdin - back it up */
+ if (PHPDBG_G(exec) && strcmp("Standard input code", PHPDBG_G(exec)) == SUCCESS)
{ /* i.e. execution context has been read from stdin - back it up */
phpdbg_file_source *data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(exec),
PHPDBG_G(exec_len));
backup_phpdbg_compile = zend_string_alloc(data->len + 2, 1);
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len,
data->buf);
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 99e6437..ca86583 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -537,16 +537,16 @@ int phpdbg_compile_stdin(zend_string *code) {
efree(PHPDBG_G(exec));
}
PHPDBG_G(exec) = estrdup("Standard input code");
- PHPDBG_G(exec_len) = 1;
+ 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);
+ 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), "Standard input code", 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);
@@ -559,7 +559,7 @@ int phpdbg_compile_stdin(zend_string *code) {
memmove(data->buf, data->buf + 2, data->len);
}
- phpdbg_notice("compile", "context=\"-\"", "Successful
compilation of stdin input");
+ phpdbg_notice("compile", "context=\"Standard input code\"",
"Successful compilation of stdin input");
return SUCCESS;
}
diff --git a/sapi/phpdbg/tests/stdin_001.phpt b/sapi/phpdbg/tests/stdin_001.phpt
index 0bc940c..2f93a2d 100644
--- a/sapi/phpdbg/tests/stdin_001.phpt
+++ b/sapi/phpdbg/tests/stdin_001.phpt
@@ -13,13 +13,13 @@ r
q
--EXPECTF--
prompt> [Successful compilation of stdin input]
-prompt> [Breakpoint #0 added at -:3]
-prompt> [Breakpoint #0 at -:3, hits: 1]
+prompt> [Breakpoint #0 added at Standard input code:3]
+prompt> [Breakpoint #0 at Standard input code:3, hits: 1]
>00003: echo "Hello, world!\n";
00004:
prompt> Hello, world!
[Script ended normally]
-prompt> [Breakpoint #0 at -:3, hits: 1]
+prompt> [Breakpoint #0 at Standard input code:3, hits: 1]
>00003: echo "Hello, world!\n";
00004:
-prompt>
\ No newline at end of file
+prompt>