WasteBasket.lua: shell quote dir name to allow for special chars.

This commit is contained in:
Ole Tange 2017-06-04 22:34:00 +02:00
parent 9e5ed8416d
commit 16daa13aa1

View file

@ -83,6 +83,9 @@ end
function directory_exists(dir)
-- 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)
end