From 766dcf4aeb0ae28c623c3e9bf47e7cbcc8fd36f4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 5 Nov 2008 11:56:44 +0000 Subject: [PATCH] Fixed return value of ArgumentParser::find() for when the search string is not found, the correct value is now -1. --- src/osg/ArgumentParser.cpp | 2 +- src/osg/DisplaySettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osg/ArgumentParser.cpp b/src/osg/ArgumentParser.cpp index 4ead39119..063e88f2c 100644 --- a/src/osg/ArgumentParser.cpp +++ b/src/osg/ArgumentParser.cpp @@ -230,7 +230,7 @@ int ArgumentParser::find(const std::string& str) const return pos; } } - return 0; + return -1; } bool ArgumentParser::match(int pos, const std::string& str) const diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index 91ff5ebf8..93ba1d8c7 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -401,7 +401,7 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments) } 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; } else if (arguments.match(pos+1,"QUAD_BUFFER")) { arguments.remove(pos,2); _stereo = true;_stereoMode = QUAD_BUFFER; }