aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-18 14:34:44 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-18 15:09:18 +0200
commit352155889aad57f8cb6d20317ffef81073fb6533 (patch)
treeccd267ebb985170c638f3b5ee07fec4c568d1962
parent8696abbe1df9bcc3abe3926a0ea6c9788ae94f58 (diff)
downloadvis-352155889aad57f8cb6d20317ffef81073fb6533.tar.gz
vis-352155889aad57f8cb6d20317ffef81073fb6533.tar.xz
vis-lua: fail more silently when visrc.lua can not be loaded
This prevents opening a separate window to display a full stack trace and improves usage of a vis binary compiled with lua support on a system without the necessary *.lua files.
-rw-r--r--vis-lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis-lua.c b/vis-lua.c
index a28efc7..b32011d 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -1178,7 +1178,8 @@ void vis_lua_init(Vis *vis) {
lua_getglobal(L, "require");
lua_pushstring(L, "visrc");
- pcall(vis, L, 1, 0);
+ if (lua_pcall(L, 1, 0, 0))
+ vis_info_show(vis, "WARNING: failed to load visrc.lua");
}
void vis_lua_start(Vis *vis) {