summaryrefslogtreecommitdiff
path: root/tex/context/base/l-dir.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-07-25 12:57:00 +0200
committerHans Hagen <pragma@wxs.nl>2014-07-25 12:57:00 +0200
commit552aceb88e5e5e77a9263144180139a6ac95646c (patch)
tree33053ce46dd12e14505d457f42f29486f16890eb /tex/context/base/l-dir.lua
parente80c75029084c0e8a80286f78150b5a2e320e63c (diff)
downloadcontext-552aceb88e5e5e77a9263144180139a6ac95646c.tar.gz
beta 2014.07.25 12:57
Diffstat (limited to 'tex/context/base/l-dir.lua')
-rw-r--r--tex/context/base/l-dir.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/tex/context/base/l-dir.lua b/tex/context/base/l-dir.lua
index 660529baf..bcf28d011 100644
--- a/tex/context/base/l-dir.lua
+++ b/tex/context/base/l-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)