From 7276e194eefc807600e1dcd10566a57e557ed1ad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 May 2006 15:29:46 +0000 Subject: [PATCH] * Disallow unescaped $ in string literals. --- src/libexpr/lexer.l | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 47f2bca1e..bc9a38da4 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -73,10 +73,7 @@ inherit { return INHERIT; } } \" { BEGIN(STRING); return '"'; } -([^\$\"\\]|\\.|\$[^\{\$])+ { -/* Note: a dollar *is* allowed as-is in a string, as long as it's - not followed by a open brace. This should probably be disallowed - eventually. */ +([^\$\"\\]|\\.)+ { yylval->t = unescapeStr(yytext); /* !!! alloc */ return STR; }