summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-11-07 19:14:40 +0000
committerMarcus Boerger <helly@php.net>2005-11-07 19:14:40 +0000
commit9c14ce94f300a14a971dd10322234a23ce85ef64 (patch)
tree887201bb0fc0d597f588a06061331298a9532f71 /sapi
parent134b2718d40be61be2a7ee5af8b32c2a90e770cb (diff)
downloadphp-git-9c14ce94f300a14a971dd10322234a23ce85ef64.tar.gz
- MFH heredoc handling in -a mode
Diffstat (limited to 'sapi')
-rw-r--r--sapi/cli/php_cli_readline.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c
index 6382b33d0f..ccdf6bd8f8 100644
--- a/sapi/cli/php_cli_readline.c
+++ b/sapi/cli/php_cli_readline.c
@@ -217,8 +217,11 @@ int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC)
}
break;
case heredoc:
- if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_len)) {
+ if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_len) && code[i] == '\n') {
code_type = body;
+ } else if (code[i - (heredoc_len + 2)] == '\n' && !strncmp(code + i - heredoc_len - 1, heredoc_tag, heredoc_len) && code[i-1] == ';' && code[i] == '\n') {
+ code_type = body;
+ valid_end = 1;
}
break;
case outside: