summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-06-25 17:45:51 +0300
committerKhaled Hosny <khaledhosny@eglug.org>2010-06-25 17:45:51 +0300
commitde1a75f617318803025eb74d8aea7409608309e2 (patch)
tree298a2286392aeca9606cca3777859179d855ffbe
parent1bce7c38af9f58e3541fc2593c1de3deda99d340 (diff)
downloadluaotfload-de1a75f617318803025eb74d8aea7409608309e2.tar.gz
Handle trailing spaces and inline comments
This turned out to be easier that I first thought.
-rw-r--r--otfl-blacklist.cnf2
-rw-r--r--otfl-font-nms.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/otfl-blacklist.cnf b/otfl-blacklist.cnf
index d9cf068..b659334 100644
--- a/otfl-blacklist.cnf
+++ b/otfl-blacklist.cnf
@@ -1,2 +1,2 @@
% Tackes ages to load
-LastResort.ttf
+LastResort.ttf % a MacOSX font, but also available for free from unicode.org
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index a8ec08a..12da443 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -465,9 +465,12 @@ local function read_blacklist()
if files and type(files) == "table" then
for _,v in next, files do
for line in io.lines(v) do
+ line = line:strip() -- to get rid of lines like " % foo"
if line:find("^%%") or line:is_empty() then
-- comment or empty line
else
+ line = line:split("%")[1]
+ line = line:strip()
if trace_search then
logs.report("blacklisted file: %s", line)
end