Diffstat (limited to 'ui-snapshot.c')
| -rw-r--r-- | ui-snapshot.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c index f25613e..5f813fc 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -175,12 +175,10 @@ void cgit_print_snapshot(const char *head, const char *hex, if (!hex && dwim) { hex = get_ref_from_filename(ctx.repo->url, filename, f); - if (hex == NULL) { - html_status(404, "Not found", 0); - return; + if (hex != NULL) { + prefix = xstrdup(filename); + prefix[strlen(filename) - strlen(f->suffix)] = '\0'; } - prefix = xstrdup(filename); - prefix[strlen(filename) - strlen(f->suffix)] = '\0'; } if (!hex) |