commit 1a86c87d670fd68b710fa0d7c8d7cbe4cfc4f87d
parent a7b0dac923c8535d091105d2921de886b4110b3b
Author: gearsix <gearsix@tuta.io>
Date: Fri, 16 Apr 2021 00:29:14 +0100
added index.html to stagit.c main()
redirects to log.html (no index.html previously caused 403 on any /x
url).
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -1147,6 +1147,12 @@ writerefs(FILE *fp)
}
void
+writeindex(FILE *fp)
+{
+ fprintf(fp, "<html><head><meta http-equiv=\"Refresh\" content=\"0; url='/%s/log.html'\" /></head><body><p>redirecting to log...</p></html>", name);
+}
+
+void
usage(char *argv0)
{
fprintf(stderr, "%s [-c cachefile | -l commits] "
@@ -1374,6 +1380,11 @@ main(int argc, char *argv[])
writeatom(fp, 0);
fclose(fp);
+ /* index page */
+ fp = efopen("index.html", "w");
+ writeindex(fp);
+ fclose(fp);
+
/* rename new cache file on success */
if (cachefile && head) {
if (rename(tmppath, cachefile))