From c10d22d72985602907439748cd261dfe6e12d9f2 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Fri, 2 Nov 2001 21:20:32 +0000 Subject: [PATCH] Fixed findFileInPath to prepend ./ if file is in local directory. This was needed by dlopen() for dso's in the current directory --- src/osgDB/FileUtils.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 307e51117..47a61ae34 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -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 );