diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-07-26 12:46:53 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-07-26 12:46:53 +0200 |
commit | f60e809b87c6d9b0ea87ceeb54507d486f2934eb (patch) | |
tree | 9fa52ea13b5e05d2c4a8ce8c81ada454bbf7c470 /lualibs-dir.lua | |
parent | cdd478fce0ba30e0a2f7af7604b05bb34e392a88 (diff) | |
download | lualibs-f60e809b87c6d9b0ea87ceeb54507d486f2934eb.tar.gz |
sync with Context as of 2014-07-26
Diffstat (limited to 'lualibs-dir.lua')
-rw-r--r-- | lualibs-dir.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lualibs-dir.lua b/lualibs-dir.lua index 660529b..bcf28d0 100644 --- a/lualibs-dir.lua +++ b/lualibs-dir.lua @@ -36,9 +36,14 @@ if onwindows then -- lfs.isdir does not like trailing / -- lfs.dir accepts trailing / + local tricky = S("/\\") * P(-1) + isdir = function(name) - name = gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode") == "directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode") == "directory" + else + return attributes(name.."/.","mode") == "directory" + end end isfile = function(name) |