diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 11:50:00 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 11:50:00 +0100 |
| commit | 761063dac4268f31c4264d4f6ea1d62c91183858 (patch) | |
| tree | a920cdfb76891cf650158f2fc79200ad95cc5b17 | |
| parent | bcca9c762ee1d27d43303a8af0c027eb85ffed4e (diff) | |
| download | vis-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.
| -rw-r--r-- | vis-lua.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |
