make reading ascii logfiles work when the input separator is different from \t.

(Wrong escape character was used for reading header fields).
This commit is contained in:
Bernhard Amann 2012-07-23 11:27:08 -07:00
parent f2e60a76a8
commit 336990e234
2 changed files with 3 additions and 3 deletions

View file

@ -144,7 +144,7 @@ bool Ascii::ReadHeader(bool useCached)
pos++;
}
//printf("Updating fields from description %s\n", line.c_str());
// printf("Updating fields from description %s\n", line.c_str());
columnMap.clear();
for ( int i = 0; i < NumFields(); i++ )
@ -199,7 +199,7 @@ bool Ascii::GetLine(string& str)
if ( str[0] != '#' )
return true;
if ( str.compare(0,8, "#fields\t") == 0 )
if ( ( str.compare(0,7, "#fields") == 0 ) && ( str[7] == separator[0] ) )
{
str = str.substr(8);
return true;

View file

@ -48,7 +48,7 @@ event line(description: Input::EventDescription, tpe: Input::Event, i: int, b: b
event bro_init()
{
try = 0;
outfile = open("../out");
outfile = open("../out");
Input::add_event([$source="../input.log", $name="input", $fields=Val, $ev=line]);
Input::remove("input");
}