diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-18 21:32:15 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-18 21:32:15 +0000 |
commit | e6253b58cdb6b3836a616821b7f5dc66790ac989 (patch) | |
tree | fc95b3a02544c7ab075aa3ed8b46178498fa78e4 | |
parent | 3f3c4cce5a6552016a040999f64dc989d203a9ef (diff) |
* Escape codes to force line breaks to be ignored.
-rw-r--r-- | src/log2xml/log2xml.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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<int> 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; |