From e6253b58cdb6b3836a616821b7f5dc66790ac989 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Mar 2004 21:32:15 +0000 Subject: [PATCH] * Escape codes to force line breaks to be ignored. --- src/log2xml/log2xml.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/log2xml/log2xml.cc b/src/log2xml/log2xml.cc index cf56374cb..66e182452 100644 --- a/src/log2xml/log2xml.cc +++ b/src/log2xml/log2xml.cc @@ -15,6 +15,7 @@ struct Decoder vector args; bool newNumber; int priority; + bool ignoreLF; Decoder() { @@ -23,6 +24,7 @@ struct Decoder inHeader = false; level = 0; priority = 1; + ignoreLF = false; } void pushChar(char c); @@ -38,7 +40,7 @@ void Decoder::pushChar(char c) case stTop: if (c == '\e') { state = stEscape; - } else if (c == '\n') { + } else if (c == '\n' && !ignoreLF) { finishLine(); } else line += c; break; @@ -75,6 +77,12 @@ void Decoder::pushChar(char c) if (line.size()) finishLine(); priority = args.size() >= 1 ? args[0] : 1; break; + case 'a': + ignoreLF = true; + break; + case 'b': + ignoreLF = false; + break; } } else if (c >= '0' && c <= '9') { int n = 0;