stagit

stagit with my modifications on tx branch
git clone git://tx.god.jp/stagit.git
Log | Files | Refs | README | LICENSE

commit 34b73a4db4daca0ebc4495c06b8dafe259fbfaca
parent 304d095d3d31cee82ac1b868d912abb946cef6b9
Author: tx <trqx@goat.si>
Date:   Wed,  2 Aug 2017 16:25:44 +0200

attempt to link to README

Diffstat:
stagit-index.c | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/stagit-index.c b/stagit-index.c @@ -25,6 +25,7 @@ static char owner[255]; #define pledge(p1,p2) 0 #endif + void joinpath(char *buf, size_t bufsiz, const char *path, const char *path2) { @@ -129,7 +130,15 @@ writelog(FILE *fp) fputs("<tr><td><a href=\"", fp); xmlencode(fp, stripped_name, strlen(stripped_name)); - fputs("/log.html\">", fp); + + // link to readme, fallback to log + char readmepath[256]; // dumb + sprintf(readmepath, "%s/file/README.html", stripped_name); + if (access(readmepath, F_OK) != -1 ) { + fputs("/file/README.html\">", fp); + } else { + fputs("/log.html\">", fp); + } xmlencode(fp, stripped_name, strlen(stripped_name)); fputs("</a></td><td>", fp); xmlencode(fp, description, strlen(description));