diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-19 15:23:28 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-19 15:28:18 +0200 |
commit | 0f11492868791513cbaae69c6476a00647f3fd47 (patch) | |
tree | bb1328076fd7d1091c1b63563cf76c8f7b936527 /ui-snapshot.c | |
parent | 09d24d7cd0b7e85633f2f43808b12871bb209d69 (diff) | |
download | cgit-master.tar.gz cgit-master.tar.bz2 cgit-master.zip |
Hi everyone, it is me, ui snapshot prefix remover 3000 here today coming
at you with another git patch
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r-- | ui-snapshot.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c index 3e38cd5..acae68c 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -308,11 +308,17 @@ void cgit_print_snapshot(const char *head, const char *hex, if (!prefix) prefix = xstrdup(cgit_snapshot_prefix(ctx.repo)); + if (!ctx.cfg.enable_snapshot_prefix && !ctx.repo->snapshot_prefix) { + free(prefix); + prefix = NULL; + } + if (sig_filename) write_sig(f, hex, filename, sig_filename); else make_snapshot(f, hex, prefix, filename); - free(prefix); + if (prefix) + free(prefix); free(adj_filename); } |