mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fixed an option processing bug
This commit is contained in:
parent
2bdc56dfcd
commit
97f7bf784b
1 changed files with 15 additions and 15 deletions
|
@ -200,23 +200,23 @@ Options parse_cmdline(int argc, char** argv)
|
||||||
zeek_args.emplace_back(argv[i]);
|
zeek_args.emplace_back(argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a script is invoked with Zeek as the interpreter, the arguments provided
|
|
||||||
// directly in the interpreter line of the script won't be broken apart in the
|
|
||||||
// argv on Linux so we split it up here.
|
|
||||||
if ( endsWith(argv[i], "--") && zeek_args.size() == 1 )
|
|
||||||
{
|
|
||||||
std::istringstream iss(argv[i]);
|
|
||||||
for ( std::string s; iss >> s; )
|
|
||||||
{
|
|
||||||
if ( ! endsWith(s, "--") )
|
|
||||||
{
|
|
||||||
zeek_args.emplace_back(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( i < argc )
|
if ( i < argc )
|
||||||
{
|
{
|
||||||
|
// If a script is invoked with Zeek as the interpreter, the arguments provided
|
||||||
|
// directly in the interpreter line of the script won't be broken apart in the
|
||||||
|
// argv on Linux so we split it up here.
|
||||||
|
if ( endsWith(argv[i], "--") && zeek_args.size() == 1 )
|
||||||
|
{
|
||||||
|
std::istringstream iss(argv[i]);
|
||||||
|
for ( std::string s; iss >> s; )
|
||||||
|
{
|
||||||
|
if ( ! endsWith(s, "--") )
|
||||||
|
{
|
||||||
|
zeek_args.emplace_back(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// There is an additional increment here to skip over the "--" if it was found.
|
// There is an additional increment here to skip over the "--" if it was found.
|
||||||
if ( endsWith(argv[i], "--") )
|
if ( endsWith(argv[i], "--") )
|
||||||
++i;
|
++i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue