7c6f58351f5c3321627e7c4020b2c5f9d8336c7b
galt
Wed Mar 3 17:34:20 2010 -0800
fixed colors, fixed counts on new files when there is no context line to finish the block, fixed bug in output of git show in diff part where odd and variable extra context appeared after @@ .* @@, currently just using sed to trim the diff file so html file inherits automatically
diff --git git-reports.c git-reports.c
index 4cdd62f..07e56ee 100644
--- git-reports.c
+++ git-reports.c
@@ -196,7 +196,7 @@
xline = htmlEncode(line);
if (line[0] == '-')
{
- fprintf(h, "%s\n", xline);
+ fprintf(h, "%s\n", xline);
if (inBody)
{
inBlock = TRUE;
@@ -205,7 +205,7 @@
}
else if (line[0] == '+')
{
- fprintf(h, "%s\n", xline);
+ fprintf(h, "%s\n", xline);
if (inBody)
{
inBlock = TRUE;
@@ -214,7 +214,10 @@
}
else
{
- fprintf(h, "%s\n", xline);
+ if (line[0] == '@')
+ fprintf(h, "%s\n", xline);
+ else
+ fprintf(h, "%s\n", xline);
if (inBody)
{
if (inBlock)
@@ -236,6 +239,20 @@
freeMem(xline);
}
+// what if there is no last trailing line to end the last block?
+if (inBody)
+ {
+ if (inBlock)
+ {
+ inBlock = FALSE;
+ if (blockP >= blockN)
+ linesChanged += blockP;
+ else
+ linesChanged += blockN;
+ blockP = 0;
+ blockN = 0;
+ }
+ }
lineFileClose(&lf);
fprintf(h, "\n