From 22fa4cc9381179fdd43ca8a251cb49dd2703079d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 22 Mar 2010 17:49:04 +0200 Subject: Sync with ConTeXt --- luaextra-dir.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'luaextra-dir.lua') diff --git a/luaextra-dir.lua b/luaextra-dir.lua index 3760db2..0d08362 100644 --- a/luaextra-dir.lua +++ b/luaextra-dir.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['l-dir'] = { license = "see context related readme files" } +-- dir.expand_name will be merged with cleanpath and collapsepath + local type = type local find, gmatch, match, gsub = string.find, string.gmatch, string.match, string.gsub local lpegmatch = lpeg.match @@ -174,7 +176,7 @@ end local make_indeed = true -- false -if string.find(os.getenv("PATH"),";") then +if string.find(os.getenv("PATH"),";") then -- os.type == "windows" function dir.mkdirs(...) local str, pth = "", "" @@ -241,7 +243,7 @@ if string.find(os.getenv("PATH"),";") then --~ print(dir.mkdirs("///a/b/c")) --~ print(dir.mkdirs("a/bbb//ccc/")) - function dir.expand_name(str) + function dir.expand_name(str) -- will be merged with cleanpath and collapsepath local first, nothing, last = match(str,"^(//)(//*)(.*)$") if first then first = lfs.currentdir() .. "/" @@ -323,7 +325,7 @@ else --~ print(dir.mkdirs("///a/b/c")) --~ print(dir.mkdirs("a/bbb//ccc/")) - function dir.expand_name(str) + function dir.expand_name(str) -- will be merged with cleanpath and collapsepath if not find(str,"^/") then str = lfs.currentdir() .. "/" .. str end -- cgit v1.2.3