i!=helpmap.end();
i++)
{
- if(!prefix.empty() && i->first.find(prefix)) // only print items with prefix
+ if(!prefix.empty() && i->first.find(prefix) != 0) // only print items with prefix
continue;
help+=" --";
string::size_type pos;
bool incremental = false;
- if(!arg.find("--") && (pos=arg.find("+="))!=string::npos) // this is a --port+=25 case
+ if(arg.find("--") == 0 && (pos=arg.find("+="))!=string::npos) // this is a --port+=25 case
{
var=arg.substr(2,pos-2);
val=arg.substr(pos+2);
incremental = true;
}
- else if(!arg.find("--") && (pos=arg.find("="))!=string::npos) // this is a --port=25 case
+ else if(arg.find("--") == 0 && (pos=arg.find("="))!=string::npos) // this is a --port=25 case
{
var=arg.substr(2,pos-2);
val=arg.substr(pos+1);
}
- else if(!arg.find("--") && (arg.find("=")==string::npos)) // this is a --daemon case
+ else if(arg.find("--") == 0 && (arg.find("=")==string::npos)) // this is a --daemon case
{
var=arg.substr(2);
val="";
{
for(int n=1;n<argc;n++) {
string varval=argv[n];
- if(!varval.find("--"+arg))
+ if(varval.find("--"+arg) == 0)
parseOne(argv[n]);
}
}
}
else {
string pkgv(PACKAGEVERSION);
- if(pkgv.find("0.0."))
+ if(pkgv.find("0.0.") != 0)
L<<Logger::Warning<<"Could not retrieve security status update for '" + pkgv + "' on '"+query+"', RCODE = "<< RCode::to_s(res)<<endl;
else
L<<Logger::Warning<<"Not validating response for security status update, this is a non-release version."<<endl;
*last_secpoll=now.tv_sec;
}
else {
- if(pkgv.find("0.0."))
+ if(pkgv.find("0.0.") != 0)
L<<Logger::Warning<<"Could not retrieve security status update for '" +pkgv+ "' on '"<<query<<"', RCODE = "<< RCode::to_s(res)<<endl;
else
L<<Logger::Warning<<"Ignoring response for security status update, this is a non-release version."<<endl;