From 67d9ecd0704f661a6d0cffa2b9cf0a6ddaeaec3a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 18 Mar 2014 20:37:33 -0500 Subject: [PATCH] Fix FS_FOpenFileReadDir non-zero file handle when file not found in pk3 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. --- code/qcommon/files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 1e66cff2..eb51faa9 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1326,6 +1326,7 @@ long FS_FOpenFileReadDir(const char *filename, searchpath_t *search, fileHandle_ return FS_fplength(filep); } + *file = 0; return -1; }