Skip to content

Commit

Permalink
Fix FS_FOpenFileReadDir non-zero file handle when file not found in pk3
Browse files Browse the repository at this point in the history
If a pk3 search path is passed to FS_FOpenFileReadDir, a non-zero
file handle is returned if file is not found. This causes incorrect
behavior in FS_ReadFileDir (when a pk3 search path is passed in)
which only checks file handle, not length, for seeing if file exists.

I don't know of any issues in ioq3 caused by this.
  • Loading branch information
zturtleman committed Mar 19, 2014
1 parent 0861d3c commit 67d9ecd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions code/qcommon/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_
return FS_fplength(filep);
}

*file = 0;
return -1;
}

Expand Down

0 comments on commit 67d9ecd

Please sign in to comment.