diff options
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 966a140..7a597ff 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
| @@ -82,7 +82,13 @@ static int make_snapshot(const struct cgit_snapshot_format *format, | |||
| 82 | return 1; | 82 | return 1; |
| 83 | } | 83 | } |
| 84 | memset(&args, 0, sizeof(args)); | 84 | memset(&args, 0, sizeof(args)); |
| 85 | args.base = fmt("%s/", prefix); | 85 | if (prefix) { |
| 86 | args.base = fmt("%s/", prefix); | ||
| 87 | args.baselen = strlen(prefix) + 1; | ||
| 88 | } else { | ||
| 89 | args.base = ""; | ||
| 90 | args.baselen = 0; | ||
| 91 | } | ||
| 86 | args.tree = commit->tree; | 92 | args.tree = commit->tree; |
| 87 | args.time = commit->date; | 93 | args.time = commit->date; |
| 88 | ctx.page.mimetype = xstrdup(format->mimetype); | 94 | ctx.page.mimetype = xstrdup(format->mimetype); |
