commit daae11dff1d35068265627b6eb903bd44f3de355
parent 1a86c87d670fd68b710fa0d7c8d7cbe4cfc4f87d
Author: gearsix <gearsix@tuta.io>
Date: Fri, 16 Apr 2021 09:27:56 +0100
added fix if .git/fork is empty
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -1261,9 +1261,9 @@ main(int argc, char *argv[])
joinpath(path, sizeof(path), repodir, ".git/fork");
if (fpread = fopen(path, "r")) {
if (fgets(url, sizeof(url), fpread)) {
- if (strlen(description) == 0)
+ if (strlen(url) > 0 && strlen(description) == 0)
snprintf(forked, 127, "forked from <a href=\"%s\">%s</a>", url, url);
- else
+ else if (strlen(url) > 0)
snprintf(forked, 127, "- forked from <a href=\"%s\">%s</a>", url, url);
}
}