summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_lexer.l
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2016-10-01 18:54:44 +0100
committerBob Weinand <bobwei9@hotmail.com>2016-10-01 19:05:19 +0100
commit9d537951c5e4af5e453dd4d60e74dad039856b80 (patch)
tree4fe7f1c6e283886c2e9099234d32bf00dd7b766b /sapi/phpdbg/phpdbg_lexer.l
parent633b93817ea9636366f56898894aa18c4d6e485b (diff)
downloadphp-git-9d537951c5e4af5e453dd4d60e74dad039856b80.tar.gz
Add proper escape sequences and reading stdin from file in phpdbg run command
Diffstat (limited to 'sapi/phpdbg/phpdbg_lexer.l')
-rw-r--r--sapi/phpdbg/phpdbg_lexer.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
index 21c4569480..b9c247a494 100644
--- a/sapi/phpdbg/phpdbg_lexer.l
+++ b/sapi/phpdbg/phpdbg_lexer.l
@@ -82,7 +82,7 @@ ID [^ \r\n\t:#\000]+
GENERIC_ID ([^ \r\n\t:#\000"']|":\\")+|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+[']
ADDR [0][x][a-fA-F0-9]+
OPCODE (ZEND_|zend_)([A-Za-z])+
-INPUT ([^\n\000#"']|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+['])+
+INPUT ([^\n\000#"']|"\\"["']|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+['])+
<!*> := yyleng = (size_t) YYCURSOR - (size_t) yytext;
@@ -160,14 +160,14 @@ INPUT ([^\n\000#"']|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|
<NORMAL>{GENERIC_ID} {
phpdbg_init_param(yylval, STR_PARAM);
- yylval->str = estrndup(yytext, yyleng - unescape_string(yytext));
+ yylval->str = estrndup(yytext + (*yytext == '\'' || *yytext == '\"'), yyleng - unescape_string(yytext));
yylval->len = yyleng;
return T_ID;
}
<RAW>{INPUT} {
phpdbg_init_param(yylval, STR_PARAM);
- yylval->str = estrndup(yytext, yyleng - unescape_string(yytext));
+ yylval->str = estrdup(yytext);
yylval->len = yyleng;
return T_INPUT;
}