From 9720307ab4d78bec3fc7bc7e44cf8ba217584a17 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 5 Apr 2012 13:27:25 +0200 Subject: Fix string escaping in config lexer --- src/config.l | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/config.l') diff --git a/src/config.l b/src/config.l index 1de0457..c352a1d 100644 --- a/src/config.l +++ b/src/config.l @@ -111,10 +111,19 @@ no { UPDATE_LOCATION; return TOK_NO; } int i, esc = 0; for (i = 0; i < yyleng; i++) { - if (yytext[i] == '\\') - esc++; - else if(esc) + if (yytext[i] == '\\') { + i++; + if (yytext[i] == '\n') { + esc+=2; + } + else { + yytext[i-esc-1] = yytext[i]; + esc++; + } + } + else if(esc) { yytext[i-esc] = yytext[i]; + } } yytext[yyleng-esc-1] = 0; yylval->str = fastd_string_stack_dup(yytext); -- cgit v1.2.3