]> git.e2factory.org Git - e2factory.git/commitdiff
Quote dir in e2lib.mkdir()
authorTobias Ulmer <tu@emlix.com>
Tue, 10 Jul 2012 13:02:39 +0000 (15:02 +0200)
committerTobias Ulmer <tu@emlix.com>
Tue, 10 Jul 2012 13:02:39 +0000 (15:02 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 24899ea8f1fe6ef507d56d3800b370d45b1a75b5..7d65d797440c4b21d0570db0dd736e05c158cd51 100644 (file)
@@ -1490,11 +1490,14 @@ end
 -- @return bool
 -- @return the last line ouf captured output
 function mkdir(dir, flags)
-       if not flags then
-               flags = ""
-       end
-       local args = string.format("%s %s", flags, dir)
-       return call_tool("mkdir", args)
+  flags = flags or ""
+  assert(type(dir) == "string")
+  assert(string.len(dir) > 0)
+  assert(type(flags) == "string")
+
+  -- TODO: quote flags as well
+  local args = string.format("%s %s", flags, e2lib.shquote(dir))
+  return call_tool("mkdir", args)
 end
 
 --- call the patch command