Introduction
Introduction Statistics Contact Development Disclaimer Help
tescape commit msg, dont indent it - stagit - static git page generator
git clone git://src.adamsgaard.dk/stagit
Log
Files
Refs
README
LICENSE
---
commit a20e271f931b37091f26bf1fff5f48060cda519c
parent 9d264890845398cf3b931b63f629c2c42a7f843d
Author: Hiltjo Posthuma <[email protected]>
Date: Mon, 7 Dec 2015 19:34:13 +0100
escape commit msg, dont indent it
Diffstat:
M urmoms.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/urmoms.c b/urmoms.c
t@@ -161,7 +161,7 @@ printcommit(FILE *fp, git_commit *commit)
const git_signature *sig;
char buf[GIT_OID_HEXSZ + 1];
int i, count;
- const char *scan, *eol;
+ const char *msg;
/* TODO: show tag when commit has it */
git_oid_tostr(buf, sizeof(buf), git_commit_id(commit));
t@@ -194,13 +194,8 @@ printcommit(FILE *fp, git_commit *commit)
}
fputc('\n', fp);
- for (scan = git_commit_message(commit); scan && *scan;) {
- for (eol = scan; *eol && *eol != '\n'; ++eol) /* find e…
- ;
-
- fprintf(fp, " %.*s\n", (int) (eol - scan), scan);
- scan = *eol ? eol + 1 : NULL;
- }
+ if ((msg = git_commit_message(commit)))
+ xmlencode(fp, msg, strlen(msg));
fputc('\n', fp);
}
t@@ -243,7 +238,6 @@ printshowfile(git_commit *commit)
if (!git_diff_get_stats(&diffstats, diff)) {
if (!git_diff_stats_to_buf(&diffstatsbuf, diffstats,
GIT_DIFF_STATS_FULL | GIT_DIFF_STATS_SHORT, 80)) {
- fputs("<hr/>", fp);
fprintf(fp, "Diffstat:\n");
fputs(diffstatsbuf.ptr, fp);
}
t@@ -405,7 +399,7 @@ printcommitatom(FILE *fp, git_commit *commit)
const git_signature *sig;
char buf[GIT_OID_HEXSZ + 1];
int i, count;
- const char *scan, *eol, *summary;
+ const char *msg, *summary;
fputs("<entry>\n", fp);
t@@ -451,15 +445,9 @@ printcommitatom(FILE *fp, git_commit *commit)
}
fputc('\n', fp);
- for (scan = git_commit_message(commit); scan && *scan;) {
- for (eol = scan; *eol && *eol != '\n'; ++eol) /* find e…
- ;
-
- fprintf(fp, " %.*s\n", (int) (eol - scan), scan);
- scan = *eol ? eol + 1 : NULL;
- }
- fputc('\n', fp);
- fputs("</content>\n", fp);
+ if ((msg = git_commit_message(commit)))
+ xmlencode(fp, msg, strlen(msg));
+ fputs("\n</content>\n", fp);
if (sig) {
fputs("<author><name>", fp);
xmlencode(fp, sig->name, strlen(sig->name));
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.