Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2014-06-29 17:59:35 +0400
committerJason Perkins <starkos@industriousone.com>2014-06-29 17:59:35 +0400
commitfec95a8ace000b2d805bd20c24d28f24b705256b (patch)
tree40fa3485b62c96437942ec30926a4b6485fdd3f8
parent9fe99f784ec5481f89668c42aa535dff74aa664b (diff)
Fix Issue #242: Recursive deletion in os.rmdir() goes up to root level on Windows 7 (Ben Henning)
-rw-r--r--src/base/os.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/base/os.lua b/src/base/os.lua
index bc33451..9332072 100644
--- a/src/base/os.lua
+++ b/src/base/os.lua
@@ -192,9 +192,10 @@
while (os.matchnext(m)) do
local isfile = os.matchisfile(m)
if ((wantfiles and isfile) or (not wantfiles and not isfile)) then
- local fname = path.join(basedir, os.matchname(m))
- if fname:match(mask) == fname then
- table.insert(result, fname)
+ local basename = os.matchname(m)
+ local fullname = path.join(basedir, basename)
+ if basename ~= ".." and fullname:match(mask) == fullname then
+ table.insert(result, fullname)
end
end
end