]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib.mv(): it's safer to pass arguments in a vector
authorTobias Ulmer <tu@emlix.com>
Thu, 1 Nov 2012 14:37:59 +0000 (15:37 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:11 +0000 (19:07 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index fda1ceedf4baf4c5392cff0e663ce3e4ccd7a049..b3393496673fec64f56f9238f5ff06cfeaec1f94 100644 (file)
@@ -1615,8 +1615,10 @@ end
 -- @return bool
 -- @return the last line ouf captured output
 function e2lib.mv(src, dst)
-    local args = string.format("'%s' '%s'", src, dst)
-    return e2lib.call_tool("mv", args)
+    assert(type(src) == "string" and type(dst) == "string")
+    assert(string.len(src) > 0 and string.len(dst) > 0)
+
+    return e2lib.call_tool_argv("mv", { src, dst })
 end
 
 --- call the cp command