Fixed findFileInPath to prepend ./ if file is in local directory. This was

needed by dlopen() for dso's in the current directory
This commit is contained in:
Don BURNS 2001-11-02 21:20:32 +00:00
parent 06abf2266b
commit c10d22d729

View File

@ -119,13 +119,18 @@ char *osgDB::findFileInPath( const char *_file, const char * filePath )
#define F_OK 4
#endif
notify(DEBUG_INFO) << "FindFileInPath() : trying " << _file << " ...\n";
if( access( _file, F_OK ) == 0 ) return (char *)_file;
char pathbuff[1024];
char *tptr, *tmppath;
char *path = 0L;
notify(DEBUG_INFO) << "FindFileInPath() : trying ./" << _file << " ...\n";
if( access( _file, F_OK ) == 0 )
{
sprintf( pathbuff,"./%s", _file );
return (char *)strdup(pathbuff);
}
tptr = strdup( filePath );
tmppath = strtok( tptr, PathDelimitor );