mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
tools/logparser.c: Fix some issues, improve output a little.
This commit is contained in:
+24
-7
@@ -469,28 +469,44 @@ static void parse_file(FILE *stream)
|
|||||||
endptr = &ptr[strlen(ptr) - 1];
|
endptr = &ptr[strlen(ptr) - 1];
|
||||||
trim_end(ptr, endptr);
|
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)
|
if (firstline)
|
||||||
{
|
{
|
||||||
printf("\t* %s", ptr);
|
printf("\t* %s", ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Was this paragraph preceded by a blank line? */
|
||||||
|
|
||||||
|
if (lastblank)
|
||||||
|
{
|
||||||
|
putchar('\n');
|
||||||
|
}
|
||||||
|
|
||||||
printf("\n\t %s", ptr);
|
printf("\n\t %s", ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstline = false;
|
||||||
|
lastblank = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
consumed = true;
|
consumed = true;
|
||||||
lastblank = false;
|
|
||||||
firstline = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,8 +521,9 @@ static void parse_file(FILE *stream)
|
|||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
name = NULL;
|
name = NULL;
|
||||||
date = NULL;
|
|
||||||
free(date);
|
free(date);
|
||||||
|
date = NULL;
|
||||||
|
|
||||||
state = STATE_IDLE;
|
state = STATE_IDLE;
|
||||||
firstline = true;
|
firstline = true;
|
||||||
merge = false;
|
merge = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user