physfs.c
changeset 44 534901592376
parent 41 ff60d39d0862
child 48 113df08e5fee
equal deleted inserted replaced
43:8a68085acebf 44:534901592376
   186 
   186 
   187 
   187 
   188 static DirHandle *openDirectory(const char *d, int forWriting)
   188 static DirHandle *openDirectory(const char *d, int forWriting)
   189 {
   189 {
   190     const DirFunctions **i;
   190     const DirFunctions **i;
       
   191 
       
   192     BAIL_IF_MACRO(!__PHYSFS_platformExists(d), ERR_NO_SUCH_FILE, NULL);
   191 
   193 
   192     for (i = dirFunctions; *i != NULL; i++)
   194     for (i = dirFunctions; *i != NULL; i++)
   193     {
   195     {
   194         if ((*i)->isArchive(d, forWriting))
   196         if ((*i)->isArchive(d, forWriting))
   195             return( (*i)->openArchive(d, forWriting) );
   197             return( (*i)->openArchive(d, forWriting) );
  1056     DirInfo *i;
  1058     DirInfo *i;
  1057 
  1059 
  1058     while (*fname == '/')
  1060     while (*fname == '/')
  1059         fname++;
  1061         fname++;
  1060 
  1062 
       
  1063     if (*fname == '\0')
       
  1064         return(1);
       
  1065 
  1061     for (i = searchPath; i != NULL; i = i->next)
  1066     for (i = searchPath; i != NULL; i = i->next)
  1062     {
  1067     {
  1063         DirHandle *h = i->dirHandle;
  1068         DirHandle *h = i->dirHandle;
  1064         if (__PHYSFS_verifySecurity(h, fname))
  1069         if (__PHYSFS_verifySecurity(h, fname))
  1065         {
  1070         {