From Jean-Sebastien Guay, "After a bit more testing, it was still not 100% robust, so this fix

will bring the change in line with what is done on other OSes (Linux)
and works in all tested cases.

For reference, this was tested with:

osgviewer <file>.wrl                (file in current directory)
osgviewer <dir>\<file>.wrl          (file in child directory, relative)
osgviewer .\<dir>\<file>.wrl        (file in child directory, specify current)
osgviewer <drive>:\<dir>\<file>.wrl (absolute path)
"
This commit is contained in:
Robert Osfield
2007-08-22 19:31:58 +00:00
parent f6d342af6f
commit bdb2a6b9d7

View File

@@ -81,13 +81,13 @@ osgDB::ReaderWriter::ReadResult ReaderWriterVRML2::readNode(const std::string &f
std::string unixFileName = osgDB::convertFileNameToUnixStyle(fileName);
#ifdef WIN32
fileName = "file://" + unixFileName;
if(unixFileName[1] == ':') // absolute path
#else
if(unixFileName[0] == '/') // absolute path
#endif
fileName = "file://" + unixFileName;
else // relative path
fileName = unixFileName;
#endif
std::fstream null;
openvrml::browser *browser = new openvrml::browser(null, null);