about summary refs log tree commit diff
path: root/ui-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui-snapshot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 5f813fc..f25613e 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -175,10 +175,12 @@ 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) {
-			prefix = xstrdup(filename);
-			prefix[strlen(filename) - strlen(f->suffix)] = '\0';
+		if (hex == NULL) {
+			html_status(404, "Not found", 0);
+			return;
 		}
+		prefix = xstrdup(filename);
+		prefix[strlen(filename) - strlen(f->suffix)] = '\0';
 	}
 
 	if (!hex)
td>Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe