stagit

fix: check readme and license before writing header

Hiltjo Posthuma contact@arjunchoudhary.com

commit: 6cb76a6 parent: 8c458a0
1 files changed, 7 insertions(+), 4 deletions(-)
Murmoms.c+7-4
M · urmoms.c +7, -4
 1@@ -577,6 +577,13 @@ main(int argc, char *argv[])
 2 		fclose(fpread);
 3 	}
 4 
 5+	/* read LICENSE */
 6+	if (!git_revparse_single(&obj, repo, "HEAD:LICENSE"))
 7+		haslicense = 1;
 8+	/* read README */
 9+	if (!git_revparse_single(&obj, repo, "HEAD:README"))
10+		hasreadme = 1;
11+
12 	/* read LICENSE */
13 	if (!git_revparse_single(&obj, repo, "HEAD:LICENSE")) {
14 		fp = efopen("license.html", "w+b");
15@@ -587,8 +594,6 @@ main(int argc, char *argv[])
16 		writefooter(fp);
17 
18 		fclose(fp);
19-
20-		haslicense = 1;
21 	}
22 
23 	/* read README */
24@@ -600,8 +605,6 @@ main(int argc, char *argv[])
25 			err(1, "fwrite");
26 		writefooter(fp);
27 		fclose(fp);
28-
29-		hasreadme = 1;
30 	}
31 
32 	fp = efopen("log.html", "w+b");