From af15026e547e6762e91573e8309cd2e61a71171d Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 10 Jul 2012 15:02:39 +0200 Subject: [PATCH] Quote dir in e2lib.mkdir() Signed-off-by: Tobias Ulmer --- generic/e2lib.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 24899ea..7d65d79 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -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 -- 2.39.5