mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 08:29:32 +02:00
fixes #869
This commit is contained in:
@@ -165,7 +165,9 @@ string PolicyCompiler_ipt::PrintRule::_printRuleLabel(PolicyRule *rule)
|
|||||||
"/FWBuilderResources/Target/options/suppress_comments");
|
"/FWBuilderResources/Target/options/suppress_comments");
|
||||||
|
|
||||||
string rl=rule->getLabel();
|
string rl=rule->getLabel();
|
||||||
if (!compiler->inSingleRuleCompileMode() && rl != current_rule_label)
|
if (rl != current_rule_label)
|
||||||
|
{
|
||||||
|
if (!compiler->inSingleRuleCompileMode())
|
||||||
{
|
{
|
||||||
if (!nocomm)
|
if (!nocomm)
|
||||||
{
|
{
|
||||||
@@ -175,22 +177,28 @@ string PolicyCompiler_ipt::PrintRule::_printRuleLabel(PolicyRule *rule)
|
|||||||
}
|
}
|
||||||
res << "echo " << _quote(string("Rule ")+rl) << endl;
|
res << "echo " << _quote(string("Rule ")+rl) << endl;
|
||||||
res << "# " << endl;
|
res << "# " << endl;
|
||||||
|
}
|
||||||
|
|
||||||
/* do not put comment in the script if it is intended for linksys */
|
/* do not put comment in the script if it is intended for linksys */
|
||||||
if (!nocomm)
|
if (!nocomm || compiler->inSingleRuleCompileMode())
|
||||||
{
|
{
|
||||||
string comm = rule->getComment();
|
string comm = rule->getComment();
|
||||||
|
if (!comm.empty())
|
||||||
|
{
|
||||||
string::size_type c1,c2;
|
string::size_type c1,c2;
|
||||||
c1=0;
|
c1=0;
|
||||||
while ( (c2=comm.find('\n',c1))!=string::npos ) {
|
while ( (c2=comm.find('\n',c1))!=string::npos )
|
||||||
|
{
|
||||||
res << "# " << comm.substr(c1,c2-c1) << endl;
|
res << "# " << comm.substr(c1,c2-c1) << endl;
|
||||||
c1=c2+1;
|
c1=c2+1;
|
||||||
}
|
}
|
||||||
res << "# " << comm.substr(c1) << endl;
|
res << "# " << comm.substr(c1) << endl;
|
||||||
res << "# " << endl;
|
res << "# " << endl;
|
||||||
}
|
}
|
||||||
current_rule_label=rl;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
current_rule_label=rl;
|
||||||
|
|
||||||
string err = rule->getStr(".error_msg");
|
string err = rule->getStr(".error_msg");
|
||||||
if (!err.empty()) res << "# " << err << endl;
|
if (!err.empty()) res << "# " << err << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user