mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 20:50:42 +00:00
set the file mode before seeking
This commit is contained in:
parent
4d74b80a38
commit
01228a8be0
1 changed files with 3 additions and 3 deletions
|
@ -332,6 +332,9 @@ COM_OpenRead (const char *path, int offs, int len, int zip)
|
||||||
Sys_Error ("Couldn't open %s", path);
|
Sys_Error ("Couldn't open %s", path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
setmode (fd, O_BINARY);
|
||||||
|
#endif
|
||||||
if (offs < 0 || len < 0) {
|
if (offs < 0 || len < 0) {
|
||||||
// normal file
|
// normal file
|
||||||
offs = 0;
|
offs = 0;
|
||||||
|
@ -353,9 +356,6 @@ COM_OpenRead (const char *path, int offs, int len, int zip)
|
||||||
lseek (fd, offs, SEEK_SET);
|
lseek (fd, offs, SEEK_SET);
|
||||||
com_filesize = len;
|
com_filesize = len;
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
setmode (fd, O_BINARY);
|
|
||||||
#endif
|
|
||||||
if (zip)
|
if (zip)
|
||||||
return Qdopen (fd, "rbz");
|
return Qdopen (fd, "rbz");
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue