From 21560db1cffd602de64d9add9712b8fa99fb8c92 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 15 Jun 2015 03:32:59 +0000 Subject: [PATCH] Strip escapes from quoted script-args before returning them --- nse_main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nse_main.lua b/nse_main.lua index 1957f7f86..a7f7235e6 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -143,6 +143,7 @@ do -- Add loader to look in nselib/?.lua (nselib/ can be in multiple places) end local lpeg = require "lpeg"; +local U = require "lpeg-utility" local locale = lpeg.locale; local P = lpeg.P; local R = lpeg.R; @@ -1192,8 +1193,7 @@ do av = Cg(V "value"); value = V "table" + V "string"; string = V "qstring" + V "uqstring"; - qstring = P "'" * C((-P "'" * (P "\\'" + P(1)))^0) * P "'" + - P '"' * C((-P '"' * (P '\\"' + P(1)))^0) * P '"'; + qstring = U.escaped_quote('"') + U.escaped_quote("'"); uqstring = V "space"^0 * C((P(1) - V "space"^0 * S ",}=")^0) * V "space"^0; -- everything but ',}=', do not capture final space }; parser = assert(P(parser));