summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-07-26 17:32:18 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-07-26 17:32:18 +0200
commit7d4e2eecc690c3e44f64c16b212ecf13b030f731 (patch)
tree77e8a216849c60c1717134d2ae0dfaaa86da5e42 /luaotfload-database.lua
parent115343e46ba6276d10db59b2994499c5d2edc8ca (diff)
downloadluaotfload-7d4e2eecc690c3e44f64c16b212ecf13b030f731.tar.gz
stript trailing slashes before joining paths
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua5
1 files changed, 5 insertions, 0 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