Commit 049da17d24a611282abd3553f6f43d75609a7fab

Stefan Sperling 2019-03-26T10:34:58

use correct diff header label for deletion in got_diff_blob_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/diff.c b/lib/diff.c
index 0a0c246..8f10487 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -175,7 +175,7 @@ got_diff_blob_file(struct got_blob_object *blob1, FILE *f2, size_t size2,
 	flags |= D_PROTOTYPE;
 
 	fprintf(outfile, "blob - %s\n", idstr1);
-	fprintf(outfile, "file + %s\n", label2);
+	fprintf(outfile, "file + %s\n", f2 == NULL ? "/dev/null" : label2);
 	err = got_diffreg(&res, f1, f2, flags, &args, &ds, outfile, NULL);
 done:
 	if (f1 && fclose(f1) != 0 && err == NULL)