Introduction
Introduction Statistics Contact Development Disclaimer Help
tFix null pointer access for submodules in writefilestree - stagit - static git…
git clone git://src.adamsgaard.dk/stagit
Log
Files
Refs
README
LICENSE
---
commit b8af751b0108edcad02bc59cec496b1d7808b0e1
parent 375d41dcce94106460f1b3855ebb295ccb138593
Author: Quentin Rameau <[email protected]>
Date: Fri, 29 Apr 2016 14:01:45 +0200
Fix null pointer access for submodules in writefilestree
Do not try to set a link to submodules from bare repo as we can't get
tthe actual url.
Diffstat:
M stagit.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/stagit.c b/stagit.c
t@@ -709,13 +709,18 @@ writefilestree(FILE *fp, git_tree *tree, const char *bra…
fprintf(fp, "%juB", (uintmax_t)filesize);
fputs("</td></tr>\n", fp);
} else if (git_submodule_lookup(&module, repo, entryname) == 0…
- moduleurl = git_submodule_url(module);
- fprintf(fp, "<tr><td>m---------</td><td><a class=\"mod…
- moduleurl);
+ fputs("<tr><td>m---------</td><td>", fp);
+ if ((moduleurl = git_submodule_url(module))) {
+ fprintf(fp, "<a class=\"module\" href=\"%s\">",
+ moduleurl);
+ }
xmlencode(fp, entrypath, strlen(entrypath));
- fputs(" @", fp);
- xmlencode(fp, moduleurl, strlen(moduleurl));
- fprintf(fp, "</a></td><td class=\"num\">0%c",
+ if (moduleurl) {
+ fputs(" @", fp);
+ xmlencode(fp, moduleurl, strlen(moduleurl));
+ fputs("</a>", fp);
+ }
+ fprintf(fp, "</td><td class=\"num\">0%c",
showlinecount ? 'L' : 'B');
git_submodule_free(module);
fputs("</td></tr>\n", fp);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.