From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Bumiller Subject: [PATCH iproute2] tc/lexer: let quotes actually start strings Date: Thu, 18 Jan 2018 11:32:34 +0100 Message-ID: <20180118103236.32494-2-w.bumiller@proxmox.com> References: <20180118103236.32494-1-w.bumiller@proxmox.com> Cc: Stephen Hemminger , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S . Miller" To: netdev@vger.kernel.org Return-path: Received: from proxmox-new.maurer-it.com ([212.186.127.180]:31382 "EHLO proxmox-new.maurer-it.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755843AbeARKck (ORCPT ); Thu, 18 Jan 2018 05:32:40 -0500 In-Reply-To: <20180118103236.32494-1-w.bumiller@proxmox.com> Sender: netdev-owner@vger.kernel.org List-ID: The lexer will go with the longest match, so previously the starting double quotes of a string would be swallowed by the [^ \t\r\n()]+ pattern leaving the user no way to actually use strings with escape sequences. Fix this by not allowing this case to start with double quotes. Signed-off-by: Wolfgang Bumiller --- tc/emp_ematch.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l index dc106759..d7a99304 100644 --- a/tc/emp_ematch.l +++ b/tc/emp_ematch.l @@ -137,7 +137,7 @@ ")" { return yylval.i = *yytext; } -[^ \t\r\n()]+ { +[^" \t\r\n()][^ \t\r\n()]* { yylval.b = bstr_alloc(yytext); if (yylval.b == NULL) return ERROR; -- 2.11.0