diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2017-01-29 17:47:57 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2017-01-29 17:48:00 +0100 |
commit | 0baccc9623891f57a302d51d40a3d1c380d910d0 (patch) | |
tree | 3a358eb8d503787986355869ce32a2eb8341feba /src | |
parent | 17a5da03053805591b11e960d0126db7f1ba4184 (diff) | |
download | luaotfload-0baccc9623891f57a302d51d40a3d1c380d910d0.tar.gz |
[main] make main() no-op when called again
Fix #390
Suggested by @davidcarlisle.
Diffstat (limited to 'src')
-rw-r--r-- | src/luaotfload-main.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 83ce5e7..bbe09fa 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -246,8 +246,18 @@ local install_loaders = function () return loaders end +local luaotfload_initialized = false --- prevent multiple invocations + luaotfload.main = function () + if luaotfload_initialized then + logreport ("log", 0, "load", + "Luaotfload initialization requested but is already \z + loaded, ignoring.") + return + end + luaotfload_initialized = true + luaotfload.loaders = install_loaders () local loaders = luaotfload.loaders local loadmodule = loaders.luaotfload |