From 352155889aad57f8cb6d20317ffef81073fb6533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 18 May 2016 14:34:44 +0200 Subject: 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. --- vis-lua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vis-lua.c') 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) { -- cgit v1.2.3