diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep the Lua-less build compiling
`cgit_abort_filters` unhooks the Lua write interposer under NO_LUA
too, where neither the hook nor its state exists, so `make NO_LUA=1`
and the default mode of `tools/release-build.sh` have not compiled
since the die path learned to take stdout back from a filter. The
suite now builds that variant into `build/nolua` and runs it, and a
`lua:` filter in such a build is refused with a message naming the
cause instead of an unknown filter type.
Diffstat (limited to '')
| -rw-r--r-- | source/filter.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 0 deletions
diff --git a/source/filter.c b/source/filter.c index f5fb2d5..dd1eaf0 100644 --- a/source/filter.c +++ b/source/filter.c @@ -444,8 +444,10 @@ void cgit_abort_filters(void) close(running_exec->old_stdout); running_exec = NULL; } +#ifndef NO_LUA if (filter_write) unhook_write(); +#endif } static const struct { @@ -503,5 +505,9 @@ struct cgit_filter *cgit_new_filter(const char *cmd, filter_type filtertype) return filter_specs[i].create(colon + 1, argument_count); } +#ifdef NO_LUA + if (len == 3 && !strncmp("lua", cmd, len)) + die("Built without Lua, cannot run filter %s", cmd); +#endif die("Invalid filter type: %.*s", (int)len, cmd); } |
