Fixed crash associated with searching in an empty filepath.
This commit is contained in:
parent
748ce4e98b
commit
f424c86465
@ -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 );
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user