1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Escape backslashes which may appear in Windows filenames.

This commit is contained in:
batrick
2012-12-16 00:02:08 +00:00
parent b0fe74e355
commit 76239f73b9

View File

@@ -648,6 +648,8 @@ local function get_chosen_scripts (rules)
local forced, rule = is_forced_set(rule);
used_rules[rule] = false; -- has not been used yet
forced_rules[rule] = forced;
-- Here we escape backslashes which might appear in Windows filenames.
rule = gsub(rule, "\\([^\\])", "\\\\%1");
-- Globalize all `names`, all visible characters not ',', '(', ')', and ';'
local globalized_rule =
gsub(rule, "[\033-\039\042-\043\045-\058\060-\126]+", globalize);