From f14def1b917834603482d5f47d5f0e4743f435d2 Mon Sep 17 00:00:00 2001 From: Aggelos Kolaitis Date: Sun, 15 Sep 2013 11:30:38 +0300 Subject: [PATCH] Updated code to use tabs for alignment --- src/base/os.lua | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/base/os.lua b/src/base/os.lua index 21b7f451..f7fc7e16 100644 --- a/src/base/os.lua +++ b/src/base/os.lua @@ -269,38 +269,38 @@ -- @brief An overloaded os.remove() that will be able to handle list of files, -- as well as wildcards for files. Uses the syntax os.matchfiles() for -- matching pattern wildcards. --- +-- -- @param f A file, a wildcard, or a list of files or wildcards to be removed -- -- @return true on success, false and an appropriate error message on error -- -- @example ok, err = os.remove{"**.bak", "**.log"} --- if not ok then --- error(err) --- end +-- if not ok then +-- error(err) +-- end -- - local builtin_remove = os.remove - function os.remove(f) - -- in case of string, just match files - if type(f) == "string" then - local p = os.matchfiles(f) - for _, v in pairs(p) do - local ok, err = builtin_remove(v) - if not ok then - return ok, err + local builtin_remove = os.remove + function os.remove(f) + -- in case of string, just match files + if type(f) == "string" then + local p = os.matchfiles(f) + for _, v in pairs(p) do + local ok, err = builtin_remove(v) + if not ok then + return ok, err end - end - -- in case of table, match files for every table entry - elseif type(f) == "table" then - for _, v in pairs(f) do - local ok, err = os.remove(v) - if not ok then - return ok, err + end + -- in case of table, match files for every table entry + elseif type(f) == "table" then + for _, v in pairs(f) do + local ok, err = os.remove(v) + if not ok then + return ok, err end - end - end - end + end + end + end --