summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaotfload-database.lua5
-rwxr-xr-xluaotfload-tool.lua3
2 files changed, 6 insertions, 2 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index b1d4877..8cf49ec 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -117,6 +117,10 @@ end
local report = logs.names_report
+local trailingslashes = P"/"^1 * P(-1)
+local stripslashes = C((1 - trailingslashes)^0)
+names.patterns = { stripslashes = stripslashes }
+
--[[doc--
We use the functions in the cache.* namespace that come with the
fontloader (see luat-basics-gen). it’s safe to use for the most part
@@ -139,6 +143,7 @@ if caches then
luaotfload.error
("Impossible to find a suitable writeable cache...")
else
+ prefix = lpegmatch (stripslashes, prefix)
report ("log", 0, "db",
"root cache directory is " .. prefix)
end
diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua
index 801ae72..78b1a61 100755
--- a/luaotfload-tool.lua
+++ b/luaotfload-tool.lua
@@ -1028,8 +1028,7 @@ do
return lpegmatch (p_permissions, raw)
end
- local trailingslashes = P"/"^1 * P(-1)
- local stripslashes = C((1 - trailingslashes)^0)
+ local stripslashes = names.patterns.stripslashes
local get_permissions = function (t, location)
if stringsub (location, #location) == "/" then