X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/2ab1cd9f3b796fa679c9d1b1ce338aaa2b0b1e53..bafab423f20bc1448b293842c235965e1681f07e:/ui-snapshot.c diff --git a/ui-snapshot.c b/ui-snapshot.c index 7374d9d..e199a92 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -14,6 +14,7 @@ static int write_archive_type(const char *format, const char *hex, const char *prefix) { struct argv_array argv = ARGV_ARRAY_INIT; + argv_array_push(&argv, "snapshot"); argv_array_push(&argv, format); if (prefix) { argv_array_push(&argv, "--prefix"); @@ -72,7 +73,7 @@ const struct cgit_snapshot_format cgit_snapshot_formats[] = { { ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive, 0x04 }, { ".tar", "application/x-tar", write_tar_archive, 0x08 }, { ".tar.xz", "application/x-xz", write_tar_xz_archive, 0x10 }, - {} + { NULL } }; static const struct cgit_snapshot_format *get_format(const char *filename) @@ -81,7 +82,7 @@ static const struct cgit_snapshot_format *get_format(const char *filename) int fl, sl; fl = strlen(filename); - for(fmt = cgit_snapshot_formats; fmt->suffix; fmt++) { + for (fmt = cgit_snapshot_formats; fmt->suffix; fmt++) { sl = strlen(fmt->suffix); if (sl >= fl) continue; @@ -152,7 +153,7 @@ static const char *get_ref_from_filename(const char *url, const char *filename, return NULL; } -void show_error(char *msg) +static void show_error(char *msg) { ctx.page.mimetype = "text/html"; cgit_print_http_headers(&ctx);