src/physfs.c
changeset 1122 a710d2a325a6
parent 1121 63800b6cf054
child 1123 6fdff9f9758d
equal deleted inserted replaced
1121:63800b6cf054 1122:a710d2a325a6
  1826     BAIL_IF_MACRO(fname == NULL, ERR_OUT_OF_MEMORY, NULL);
  1826     BAIL_IF_MACRO(fname == NULL, ERR_OUT_OF_MEMORY, NULL);
  1827     if (sanitizePlatformIndependentPath(_fname, fname))
  1827     if (sanitizePlatformIndependentPath(_fname, fname))
  1828     {
  1828     {
  1829         DirHandle *i;
  1829         DirHandle *i;
  1830         __PHYSFS_platformGrabMutex(stateLock);
  1830         __PHYSFS_platformGrabMutex(stateLock);
  1831         for (i = searchPath; ((i != NULL) && (retval == NULL)); i = i->next)
  1831         for (i = searchPath; i != NULL; i = i->next)
  1832         {
  1832         {
  1833             char *arcfname = fname;
  1833             char *arcfname = fname;
  1834             if (partOfMountPoint(i, arcfname))
  1834             if (partOfMountPoint(i, arcfname))
       
  1835             {
  1835                 retval = i->dirName;
  1836                 retval = i->dirName;
       
  1837                 break;
       
  1838             } /* if */
  1836             else if (verifyPath(i, &arcfname, 0))
  1839             else if (verifyPath(i, &arcfname, 0))
  1837             {
  1840             {
  1838                 if (i->funcs->exists(i->opaque, arcfname))
  1841                 if (i->funcs->exists(i->opaque, arcfname))
       
  1842                 {
  1839                     retval = i->dirName;
  1843                     retval = i->dirName;
       
  1844                     break;
       
  1845                 } /* if */
  1840             } /* if */
  1846             } /* if */
  1841         } /* for */
  1847         } /* for */
  1842         __PHYSFS_platformReleaseMutex(stateLock);
  1848         __PHYSFS_platformReleaseMutex(stateLock);
  1843     } /* if */
  1849     } /* if */
  1844 
  1850