Fixed crash associated with searching in an empty filepath.

This commit is contained in:
Robert Osfield 2002-05-25 09:30:38 +00:00
parent 748ce4e98b
commit f424c86465
2 changed files with 6 additions and 1 deletions

View File

@ -93,6 +93,7 @@ char *osgDB::findFileInPath( const char *_file, const char * filePath )
char *path = 0L;
notify(DEBUG_INFO) << "FindFileInPath() : trying " << _file << " ...\n";
if( access( _file, F_OK ) == 0 )
{
return strdup(_file);
@ -100,7 +101,9 @@ char *osgDB::findFileInPath( const char *_file, const char * filePath )
tptr = strdup( filePath );
tmppath = strtok( tptr, PathDelimitor );
if (!tmppath) return NULL;
do
{
sprintf( pathbuff, "%s/%s", tmppath, _file );

View File

@ -93,6 +93,8 @@ char *osgDB::findFileInPath( const char *_file, const char * filePath )
tptr = strdup( filePath );
tmppath = strtok( tptr, PathDelimitor );
if (!tmppath) return NULL;
do
{
sprintf( pathbuff, "%s/%s", tmppath, _file );