https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbaa875f05b174594add8…
commit dbaa875f05b174594add8bba3287ca1e6145862f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Dec 8 17:31:17 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Dec 8 17:38:03 2018 +0100
[LOG2LINES] Fix indentation.
---
sdk/tools/log2lines/log2lines.c | 170 ++++++++++++++++++++--------------------
1 file changed, 85 insertions(+), 85 deletions(-)
diff --git a/sdk/tools/log2lines/log2lines.c b/sdk/tools/log2lines/log2lines.c
index f55e5ee5a1..025ccaa49e 100644
--- a/sdk/tools/log2lines/log2lines.c
+++ b/sdk/tools/log2lines/log2lines.c
@@ -420,120 +420,120 @@ translate_files(FILE *inFile, FILE *outFile)
const char *p = kdbg_prompt;
const char *p_eos = p + sizeof(KDBG_PROMPT) - 1; //end of string pos
- memset(Line, '\0', LINESIZE + 1);
- if (opt_console)
+ memset(Line, '\0', LINESIZE + 1);
+ if (opt_console)
+ {
+ while ((c = fgetc(inFile)) != EOF)
{
- while ((c = fgetc(inFile)) != EOF)
- {
- if (opt_quit)break;
+ if (opt_quit)break;
- ch = (unsigned char)c;
- if (!opt_raw)
+ ch = (unsigned char)c;
+ if (!opt_raw)
+ {
+ switch (ch)
{
- switch (ch)
+ case '\n':
+ if ( strncmp(Line, KDBG_DISCARD, sizeof(KDBG_DISCARD)-1) == 0 )
{
- case '\n':
- if ( strncmp(Line, KDBG_DISCARD, sizeof(KDBG_DISCARD)-1) == 0 )
- {
- memset(Line, '\0', LINESIZE); // flushed
- }
- else
+ memset(Line, '\0', LINESIZE); // flushed
+ }
+ else
+ {
+ Line[1] = handle_escape_cmd(outFile, Line, path, LineOut);
+ if (Line[1] != KDBG_ESC_CHAR)
{
- Line[1] = handle_escape_cmd(outFile, Line, path, LineOut);
- if (Line[1] != KDBG_ESC_CHAR)
+ if (p == p_eos)
{
- if (p == p_eos)
+ // kdbg prompt, so already echoed char by char
+ memset(Line, '\0', LINESIZE);
+ translate_char(c, outFile);
+ }
+ else
+ {
+ if (match_line(outFile, Line))
{
- // kdbg prompt, so already echoed char by char
- memset(Line, '\0', LINESIZE);
+ translate_line(outFile, Line, path, LineOut);
translate_char(c, outFile);
- }
- else
- {
- if (match_line(outFile, Line))
- {
- translate_line(outFile, Line, path, LineOut);
- translate_char(c, outFile);
- report(outFile);
- }
+ report(outFile);
}
}
}
- i = 0;
- p = kdbg_prompt;
- pc = kdbg_cont;
- break;
- case '<':
- i = 0;
- Line[i++] = ch;
- break;
- case '>':
- if (ch == *p)
- {
- p = p_eos;
- translate_line(outFile, Line, path, LineOut);
- }
+ }
+ i = 0;
+ p = kdbg_prompt;
+ pc = kdbg_cont;
+ break;
+ case '<':
+ i = 0;
+ Line[i++] = ch;
+ break;
+ case '>':
+ if (ch == *p)
+ {
+ p = p_eos;
+ translate_line(outFile, Line, path, LineOut);
+ }
- if (p != p_eos)
- {
- if (i < LINESIZE)
- {
- Line[i++] = ch;
- translate_line(outFile, Line, path, LineOut);
- }
- else
- {
- translate_line(outFile, Line, path, LineOut);
- translate_char(c, outFile);
- }
- }
- else
- translate_char(c, outFile);
- i = 0;
- break;
- default:
- if (ch == *p)p++;
- if (ch == *pc)pc++;
+ if (p != p_eos)
+ {
if (i < LINESIZE)
{
Line[i++] = ch;
- if (p == p_eos)
- {
- translate_char(c, outFile);
- }
- else if (!*pc)
- {
- translate_line(outFile, Line, path, LineOut);
- i = 0;
- }
+ translate_line(outFile, Line, path, LineOut);
}
else
{
translate_line(outFile, Line, path, LineOut);
translate_char(c, outFile);
+ }
+ }
+ else
+ translate_char(c, outFile);
+ i = 0;
+ break;
+ default:
+ if (ch == *p)p++;
+ if (ch == *pc)pc++;
+ if (i < LINESIZE)
+ {
+ Line[i++] = ch;
+ if (p == p_eos)
+ {
+ translate_char(c, outFile);
+ }
+ else if (!*pc)
+ {
+ translate_line(outFile, Line, path, LineOut);
i = 0;
}
}
+ else
+ {
+ translate_line(outFile, Line, path, LineOut);
+ translate_char(c, outFile);
+ i = 0;
+ }
}
- else
- translate_char(c, outFile);
}
+ else
+ translate_char(c, outFile);
}
- else
- { // Line by line, slightly faster but less interactive
- while (fgets(Line, LINESIZE, inFile) != NULL)
- {
- if (opt_quit)break;
+ }
+ else
+ { // Line by line, slightly faster but less interactive
+ while (fgets(Line, LINESIZE, inFile) != NULL)
+ {
+ if (opt_quit)break;
- if (!opt_raw)
- {
- translate_line(outFile, Line, path, LineOut);
- report(outFile);
- }
- else
- log(outFile, "%s", Line);
+ if (!opt_raw)
+ {
+ translate_line(outFile, Line, path, LineOut);
+ report(outFile);
}
+ else
+ log(outFile, "%s", Line);
}
+ }
if (opt_Revision && (strstr(opt_Revision, "regscan") ==
opt_Revision))
{