escape filenames for mv commands

This commit is contained in:
Axel Kittenberger 2011-03-24 06:42:00 +00:00
parent 9a065476d1
commit f17e82ce5c

View File

@ -1002,7 +1002,7 @@ local Excludes = (function()
-- --
local function toLuaPattern(p) local function toLuaPattern(p)
local o = p local o = p
p = string.gsub(p, "%%", "%%") p = string.gsub(p, "%%", "%%") -- TODO check
p = string.gsub(p, "%^", "%%^") p = string.gsub(p, "%^", "%%^")
p = string.gsub(p, "%$", "%%$") p = string.gsub(p, "%$", "%%$")
p = string.gsub(p, "%(", "%%(") p = string.gsub(p, "%(", "%%(")
@ -3245,9 +3245,10 @@ local default_rsyncssh = {
log("Normal", "Moving ",event.path," -> ",event2.path) log("Normal", "Moving ",event.path," -> ",event2.path)
spawn(event, "/usr/bin/ssh", spawn(event, "/usr/bin/ssh",
config.host, "mv", config.host, "mv",
config.targetdir .. event.path, '\"' .. config.targetdir .. event.path .. '\"',
config.targetdir .. event2.path, '\"' .. config.targetdir .. event2.path .. '\"',
"||", "rm", "-rf", config.targetdir .. event.path) "||", "rm", "-rf",
'\"' .. config.targetdir .. event.path .. '\"')
return return
end end