summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-sbx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-02-19 17:46:26 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-02-19 17:46:26 +0100
commitb5ef32a9a6a99e134e669b702e89a55fbabf5306 (patch)
treee0b152cee73c98ea43d93e707dad31bfdebc1ef0 /tex/context/base/mkiv/util-sbx.lua
parent601e63e757d4cf40d5923cee4b6b3debff57364c (diff)
downloadcontext-b5ef32a9a6a99e134e669b702e89a55fbabf5306.tar.gz
2017-02-19 17:20:00
Diffstat (limited to 'tex/context/base/mkiv/util-sbx.lua')
-rw-r--r--tex/context/base/mkiv/util-sbx.lua32
1 files changed, 20 insertions, 12 deletions
diff --git a/tex/context/base/mkiv/util-sbx.lua b/tex/context/base/mkiv/util-sbx.lua
index 48c424f00..0db2e0295 100644
--- a/tex/context/base/mkiv/util-sbx.lua
+++ b/tex/context/base/mkiv/util-sbx.lua
@@ -58,12 +58,22 @@ local function registerroot(root,what) -- what == read|write
if finalized then
report("roots are already finalized")
else
- root = collapsepath(expandname(root))
- if platform == "windows" then
- root = lower(root) -- we assume ascii names
+ if type(root) == "table" then
+ root, what = root[1], root[2]
+ end
+ if type(root) == "string" and root ~= "" then
+ root = collapsepath(expandname(root))
+ -- if platform == "windows" then
+ -- root = lower(root) -- we assume ascii names
+ -- end
+ if what == "r" or what == "ro" or what == "readable" then
+ what = "read"
+ elseif what == "w" or what == "wo" or what == "writable" then
+ what = "write"
+ end
+ -- true: read & write | false: read
+ validroots[root] = what == "write" or false
end
- -- true: read & write | false: read
- validroots[root] = what == "write" or false
end
end
@@ -146,9 +156,9 @@ end
local function validfilename(name,what)
if p_validroot and type(name) == "string" and lpegmatch(p_path,name) then
local asked = collapsepath(expandname(name))
- if platform == "windows" then
- asked = lower(asked) -- we assume ascii names
- end
+ -- if platform == "windows" then
+ -- asked = lower(asked) -- we assume ascii names
+ -- end
local okay = lpegmatch(p_validroot,asked)
if okay == true then
-- read and write access
@@ -175,10 +185,8 @@ local function validfilename(name,what)
end
return name
end
- else
- if filenamelogger then
- filenamelogger(name,"*",name,false)
- end
+ elseif filenamelogger then
+ filenamelogger(name,"*",name,false)
end
else
return name