# HG changeset patch # User Ryan C. Gordon # Date 1283132198 14400 # Node ID a710d2a325a663a4c26648536c94a1660053eb60 # Parent 63800b6cf054e3b04ccf903933cccde08461aed9 PHYSFS_getRealDir() can't report a path for things that aren't real files. diff -r 63800b6cf054 -r a710d2a325a6 src/physfs.c --- a/src/physfs.c Mon Aug 30 02:39:28 2010 -0400 +++ b/src/physfs.c Sun Aug 29 21:36:38 2010 -0400 @@ -1828,15 +1828,21 @@ { DirHandle *i; __PHYSFS_platformGrabMutex(stateLock); - for (i = searchPath; ((i != NULL) && (retval == NULL)); i = i->next) + for (i = searchPath; i != NULL; i = i->next) { char *arcfname = fname; if (partOfMountPoint(i, arcfname)) + { retval = i->dirName; + break; + } /* if */ else if (verifyPath(i, &arcfname, 0)) { if (i->funcs->exists(i->opaque, arcfname)) + { retval = i->dirName; + break; + } /* if */ } /* if */ } /* for */ __PHYSFS_platformReleaseMutex(stateLock); diff -r 63800b6cf054 -r a710d2a325a6 src/physfs.h --- a/src/physfs.h Mon Aug 30 02:39:28 2010 -0400 +++ b/src/physfs.h Sun Aug 29 21:36:38 2010 -0400 @@ -1020,6 +1020,11 @@ * be associated with the first archive mounted there, even though that * directory isn't necessarily contained in a real archive. * + * \warning This will return NULL if there is no real directory associated + * with (filename). Specifically, PHYSFS_mountIo(), + * PHYSFS_mountMemory(), and PHYSFS_mountHandle() will return NULL + * even if the filename is found in the search path. Plan accordingly. + * * \param filename file to look for. * \return READ ONLY string of element of search path containing the * the file in question. NULL if not found.