From: Marcus Boerger Date: Mon, 7 Nov 2005 19:14:40 +0000 (+0000) Subject: - MFH heredoc handling in -a mode X-Git-Tag: php-5.1.0RC5~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c14ce94f300a14a971dd10322234a23ce85ef64;p=php - MFH heredoc handling in -a mode --- 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: