From 16daa13aa11c3bdb005b92761cb6a3e7c1fc7e66 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 4 Jun 2017 22:34:00 +0200 Subject: [PATCH] WasteBasket.lua: shell quote dir name to allow for special chars. --- wastebasket/WasteBasket.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wastebasket/WasteBasket.lua b/wastebasket/WasteBasket.lua index 1b8cfa2..a56469f 100644 --- a/wastebasket/WasteBasket.lua +++ b/wastebasket/WasteBasket.lua @@ -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