aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-08 11:50:00 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-08 11:50:00 +0100
commit761063dac4268f31c4264d4f6ea1d62c91183858 (patch)
treea920cdfb76891cf650158f2fc79200ad95cc5b17 /vis-lua.c
parentbcca9c762ee1d27d43303a8af0c027eb85ffed4e (diff)
downloadvis-761063dac4268f31c4264d4f6ea1d62c91183858.tar.gz
vis-761063dac4268f31c4264d4f6ea1d62c91183858.tar.xz
vis-lua: only fail file_save_pre event if explicitly returned false
Previously we would also interpret a missing return value `nil` as is the case when no pre save event handler is subscribed as failure.
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 7318ec3..42196d1 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2049,7 +2049,7 @@ bool vis_lua_file_save_pre(Vis *vis, File *file, const char *path) {
lua_pushstring(L, path);
if (pcall(vis, L, 2, 1) != 0)
return false;
- return lua_toboolean(L, -1);
+ return !lua_isboolean(L, -1) || lua_toboolean(L, -1);
}
lua_pop(L, 1);
return true;