added missing close for a file search handle

This commit is contained in:
oy 2011-12-04 17:21:34 +01:00
parent c3a91f19b3
commit 9221f3dda2

View file

@ -278,8 +278,13 @@ IOHANDLE io_open(const char *filename, int flags)
if(!filename || !length || filename[length-1] == '\\')
return 0x0;
handle = FindFirstFile(filename, &finddata);
if(handle == INVALID_HANDLE_VALUE || str_comp(filename+length-str_length(finddata.cFileName), finddata.cFileName))
if(handle == INVALID_HANDLE_VALUE)
return 0x0;
else if(str_comp(filename+length-str_length(finddata.cFileName), finddata.cFileName) != 0)
{
FindClose(handle);
return 0x0;
}
FindClose(handle);
#endif
return (IOHANDLE)fopen(filename, "rb");