src/physfs.c
changeset 1122 a710d2a325a6
parent 1121 63800b6cf054
child 1123 6fdff9f9758d
--- 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);