Special-case optimization in __PHYSFS_verifySecurity().

This commit is contained in:
Ryan C. Gordon 2002-08-22 00:13:48 +00:00
parent 593db4b13b
commit 2e0c0faa1d
1 changed files with 4 additions and 3 deletions

View File

@ -1196,7 +1196,6 @@ char * __PHYSFS_convertToDependent(const char *prepend,
int __PHYSFS_verifySecurity(DirHandle *h, const char *fname) int __PHYSFS_verifySecurity(DirHandle *h, const char *fname)
{ {
int retval = 1; int retval = 1;
int fileExists;
char *start; char *start;
char *end; char *end;
char *str; char *str;
@ -1224,14 +1223,16 @@ int __PHYSFS_verifySecurity(DirHandle *h, const char *fname)
if (!allowSymLinks) if (!allowSymLinks)
{ {
if (h->funcs->isSymLink(h, str, &fileExists)) if (h->funcs->isSymLink(h, str, &retval))
{ {
__PHYSFS_setError(ERR_SYMLINK_DISALLOWED); __PHYSFS_setError(ERR_SYMLINK_DISALLOWED);
retval = 0; retval = 0;
break; break;
} /* if */ } /* if */
/* !!! FIXME: Abort early here if !fileExists? */ /* break out early if path element is missing. */
if (!retval)
break;
} /* if */ } /* if */
if (end == NULL) if (end == NULL)