merge: tc/lexer: let quotes actually start strings
[iproute2.git] / debian / patches / 0005-tc-lexer-let-quotes-actually-start-strings.patch
1 From 0df91939df1da6e72fd14ef2788984685e0aeff7 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Thu, 18 Jan 2018 10:26:12 +0100
4 Subject: [PATCH iproute2] tc/lexer: let quotes actually start strings
5
6 The lexer will go with the longest match, so previously
7 the starting double quotes of a string would be swallowed by
8 the [^ \t\r\n()]+ pattern leaving the user no way to
9 actually use strings with escape sequences.
10 Fix this by not allowing this case to start with double
11 quotes.
12
13 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
14 ---
15 (Resent as separate thread)
16  tc/emp_ematch.l | 2 +-
17  1 file changed, 1 insertion(+), 1 deletion(-)
18
19 diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l
20 index dc106759..d7a99304 100644
21 --- a/tc/emp_ematch.l
22 +++ b/tc/emp_ematch.l
23 @@ -137,7 +137,7 @@
24  ")"                                    {
25                                                 return yylval.i = *yytext;
26                                         }
27 -[^ \t\r\n()]+                          {
28 +[^" \t\r\n()][^ \t\r\n()]*             {
29                                                 yylval.b = bstr_alloc(yytext);
30                                                 if (yylval.b == NULL)
31                                                         return ERROR;
32 -- 
33 2.11.0
34