mirror of
https://github.com/nmap/nmap.git
synced 2025-12-16 04:39:03 +00:00
Escape backslashes which may appear in Windows filenames.
This commit is contained in:
@@ -648,6 +648,8 @@ local function get_chosen_scripts (rules)
|
|||||||
local forced, rule = is_forced_set(rule);
|
local forced, rule = is_forced_set(rule);
|
||||||
used_rules[rule] = false; -- has not been used yet
|
used_rules[rule] = false; -- has not been used yet
|
||||||
forced_rules[rule] = forced;
|
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 ';'
|
-- Globalize all `names`, all visible characters not ',', '(', ')', and ';'
|
||||||
local globalized_rule =
|
local globalized_rule =
|
||||||
gsub(rule, "[\033-\039\042-\043\045-\058\060-\126]+", globalize);
|
gsub(rule, "[\033-\039\042-\043\045-\058\060-\126]+", globalize);
|
||||||
|
|||||||
Reference in New Issue
Block a user