Fix FS_FOpenFileRead corner case

FS_FOpenFileRead is a fairly mental function that changes its return
behaviour depending on whether or not file is NULL or not. It turns out
in the case where file is NULL, we were returning the wrong value when
the file didn't exist.
This commit is contained in:
Tim Angus 2013-01-13 22:05:58 +00:00
parent 693e51c654
commit 5fd456ff7c

View file

@ -1361,10 +1361,17 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF
#endif #endif
if(file) if(file)
{
*file = 0; *file = 0;
return -1; return -1;
} }
else
{
// When file is NULL, we're querying the existance of the file
// If we've got here, it doesn't exist
return 0;
}
}
/* /*
================= =================