summaryrefslogtreecommitdiff
path: root/tex/context/base/l-file.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-05-22 23:00:25 +0300
committerMarius <mariausol@gmail.com>2013-05-22 23:00:25 +0300
commita61813ccdd4b7bcc81932317e1360fda6c79962d (patch)
treedfafb69e9a6854747a637aaef661c5d269214a0f /tex/context/base/l-file.lua
parent4cbc44edaf20dc07bd22296153761137b27d8eff (diff)
downloadcontext-a61813ccdd4b7bcc81932317e1360fda6c79962d.tar.gz
beta 2013.05.22 19:28
Diffstat (limited to 'tex/context/base/l-file.lua')
-rw-r--r--tex/context/base/l-file.lua19
1 files changed, 8 insertions, 11 deletions
diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua
index deaaca735..a64ee8656 100644
--- a/tex/context/base/l-file.lua
+++ b/tex/context/base/l-file.lua
@@ -585,18 +585,15 @@ end
-- end
-- end
--- a goodie: a dumb version of mkdirs:
+-- a goodie: a dumb version of mkdirs (not used in context itself, only
+-- in generic usage)
function lfs.mkdirs(path)
- local full
- for sub in gmatch(path,"([^\\/]+)") do
- if full then
- full = full .. "/" .. sub
- else
- full = sub
- end
- if not lfs.isdir(full) then
- lfs.mkdir(full)
- end
+ local full = ""
+ for sub in gmatch(path,"(/*[^\\/]+)") do -- accepts leading c: and /
+ full = full .. sub
+ -- lfs.isdir("/foo") mistakenly returns true on windows so
+ -- so we don't test and just make as that one is not too picky
+ lfs.mkdir(full)
end
end