mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Logdir: Change requested by 0xxon, no problem
Suggestion from 0xxon to look at Input Framework inspired this change
This commit is contained in:
parent
6bde33aca7
commit
74561e922f
2 changed files with 11 additions and 4 deletions
|
@ -457,10 +457,17 @@ bool Ascii::DoInit(const WriterInfo& info, int num_fields, const threading::Fiel
|
|||
ext += gzip_file_extension.empty() ? "gz" : gzip_file_extension;
|
||||
}
|
||||
|
||||
if ( ! logdir.empty() )
|
||||
if ( fname.front() != '/' && ! logdir.empty() )
|
||||
{
|
||||
fname = logdir.empty() ? fname : logdir + "/" + fname;
|
||||
}
|
||||
string path = logdir;
|
||||
std::size_t last = path.find_last_not_of('/');
|
||||
|
||||
if ( last == string::npos ) // Nothing but slashes -- weird but ok...
|
||||
path = "/";
|
||||
else
|
||||
path.erase(last + 1);
|
||||
fname = path + "/" + fname;
|
||||
}
|
||||
|
||||
fname += ext;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue