diff options
Diffstat (limited to 'cgit-about-filter.c')
-rw-r--r-- | cgit-about-filter.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cgit-about-filter.c b/cgit-about-filter.c index 68dfd9b..02b6043 100644 --- a/cgit-about-filter.c +++ b/cgit-about-filter.c @@ -4,13 +4,11 @@ #include <string.h> #include <unistd.h> -#define EXEC(args) execvp(args[0], args) +#define EXEC1(args) execvp(args[0], args) +#define EXEC(...) EXEC1(((char *const []){ __VA_ARGS__, NULL })) static const char *extension(const char *filename); -char *mandoc[] = { "mandoc", "-Thtml", "-Ofragment", NULL }; -char *lowdown[] = { "lowdown", "-Thtml", NULL }; - int main(int argc, char *argv[]) { @@ -28,9 +26,9 @@ main(int argc, char *argv[]) return 1; if (strlen(ext) == 1 && isdigit(*ext)) { - EXEC(mandoc); + EXEC("mandoc", "-Thtml", "-Ofragment"); } else if (strcmp(ext, "md") == 0) { - EXEC(lowdown); + EXEC("lowdown", "-Thtml"); } return 1; |