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

github.com/windirstat/premake-4.x-stable.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
commit849510cf35ea35d1463382997d9381bf4a728146 (patch)
tree40fa3485b62c96437942ec30926a4b6485fdd3f8
parent82cf84196cc9e5933caf97225bbba833cb348647 (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