Fixed return value of ArgumentParser::find() for when the search string is not found, the correct value is now -1.
This commit is contained in:
@@ -230,7 +230,7 @@ int ArgumentParser::find(const std::string& str) const
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ArgumentParser::match(int pos, const std::string& str) const
|
bool ArgumentParser::match(int pos, const std::string& str) const
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int pos;
|
int pos;
|
||||||
while ((pos=arguments.find("--stereo"))!=0)
|
while ((pos=arguments.find("--stereo"))>0)
|
||||||
{
|
{
|
||||||
if (arguments.match(pos+1,"ANAGLYPHIC")) { arguments.remove(pos,2); _stereo = true;_stereoMode = ANAGLYPHIC; }
|
if (arguments.match(pos+1,"ANAGLYPHIC")) { arguments.remove(pos,2); _stereo = true;_stereoMode = ANAGLYPHIC; }
|
||||||
else if (arguments.match(pos+1,"QUAD_BUFFER")) { arguments.remove(pos,2); _stereo = true;_stereoMode = QUAD_BUFFER; }
|
else if (arguments.match(pos+1,"QUAD_BUFFER")) { arguments.remove(pos,2); _stereo = true;_stereoMode = QUAD_BUFFER; }
|
||||||
|
|||||||
Reference in New Issue
Block a user