tools/logparser.c: Fix some issues, improve output a little.

This commit is contained in:
Gregory Nutt
2018-01-29 11:51:43 -06:00
parent fce345113f
commit 4b44a84bc9
+24 -7
View File
@@ -469,28 +469,44 @@ static void parse_file(FILE *stream)
endptr = &ptr[strlen(ptr) - 1];
trim_end(ptr, endptr);
/* Was this paragraph preceded by a blank line? */
/* Skip over certain crap lines added by GIT; Skip over
* merge entries.
*/
if (!merge)
if (strncmp(ptr, "Merged in ", 10) != 0 &&
strncmp(ptr, "Approved-by: ", 13) != 0 &&
!merge)
{
if (lastblank)
/* Change leading "* " to "- " */
if (ptr[0] == '*' && ptr[1] == ' ')
{
putchar('\n');
*ptr = '-';
}
/* Is this the first paragraph in the body? */
if (firstline)
{
printf("\t* %s", ptr);
}
else
{
/* Was this paragraph preceded by a blank line? */
if (lastblank)
{
putchar('\n');
}
printf("\n\t %s", ptr);
}
firstline = false;
lastblank = false;
}
consumed = true;
lastblank = false;
firstline = false;
break;
}
@@ -505,8 +521,9 @@ static void parse_file(FILE *stream)
free(name);
name = NULL;
date = NULL;
free(date);
date = NULL;
state = STATE_IDLE;
firstline = true;
merge = false;