WasteBasket.lua: shell quote dir name to allow for special chars.
This commit is contained in:
parent
9e5ed8416d
commit
16daa13aa1
|
@ -83,6 +83,9 @@ end
|
||||||
|
|
||||||
function directory_exists(dir)
|
function directory_exists(dir)
|
||||||
-- Simple checker if dir exists
|
-- Simple checker if dir exists
|
||||||
|
-- shell quote the dirname
|
||||||
|
dir, _ = dir:gsub("([\002-\009\011-\026\\#?`(){}%[%]^*<>=~|; \"!$&'\130-\255])", "\\%1")
|
||||||
|
dir, _ = dir:gsub("\n", "'\n'")
|
||||||
return os.execute("cd " .. dir)
|
return os.execute("cd " .. dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue