make sure not partial (invalid) utf-8 sequences are written. The old logic
truncated by bytelen was wrong. It is too complex to implement it in a
correct way with git: it is not assured a commit message is UTF-8 encoded.
remove showlinecount and summarylen variables.
-/* summary length (bytes) in the log */
-static const unsigned summarylen = 70;
-/* display line count or file size in file tree index */
-static const int showlinecount = 1;
-
static git_repository *repo;
static const char *relpath = "";
static git_repository *repo;
static const char *relpath = "";
void
writelogline(FILE *fp, struct commitinfo *ci)
{
void
writelogline(FILE *fp, struct commitinfo *ci)
{
fputs("<tr><td>", fp);
if (ci->author)
printtimeshort(fp, &(ci->author->when));
fputs("</td><td>", fp);
if (ci->summary) {
fprintf(fp, "<a href=\"%scommit/%s.html\">", relpath, ci->oid);
fputs("<tr><td>", fp);
if (ci->author)
printtimeshort(fp, &(ci->author->when));
fputs("</td><td>", fp);
if (ci->summary) {
fprintf(fp, "<a href=\"%scommit/%s.html\">", relpath, ci->oid);
- if ((len = strlen(ci->summary)) > summarylen) {
- xmlencode(fp, ci->summary, summarylen - 1);
- fputs("…", fp);
- } else {
- xmlencode(fp, ci->summary, len);
- }
+ xmlencode(fp, ci->summary, strlen(ci->summary));
fputs("</a>", fp);
}
fputs("</td><td>", fp);
fputs("</a>", fp);
}
fputs("</td><td>", fp);
fprintf(fp, "</td><td><a href=\"%s%s\">", relpath, filepath);
xmlencode(fp, entrypath, strlen(entrypath));
fputs("</a></td><td class=\"num\" align=\"right\">", fp);
fprintf(fp, "</td><td><a href=\"%s%s\">", relpath, filepath);
xmlencode(fp, entrypath, strlen(entrypath));
fputs("</a></td><td class=\"num\" align=\"right\">", fp);
- if (showlinecount && lc > 0)
fprintf(fp, "%dL", lc);
else
fprintf(fp, "%juB", (uintmax_t)filesize);
fprintf(fp, "%dL", lc);
else
fprintf(fp, "%juB", (uintmax_t)filesize);