qbyte* buffer;
size_t buffersize;
+ // if this is an uncompressed real file we can just call the kernel seek
+ // (necessary when writing files)
+ if (file->offset == 0 && ! (file->flags & QFILE_FLAG_DEFLATED))
+ return lseek (file->handle, offset, whence);
+
// Compute the file offset
switch (whence)
{
*/
long FS_Tell (qfile_t* file)
{
- return file->position - file->buff_len + file->buff_ind;
+ // if this is an uncompressed real file we can just call the kernel tell
+ // (necessary when writing files)
+ if (file->offset == 0 && ! (file->flags & QFILE_FLAG_DEFLATED))
+ return lseek (file->handle, 0, SEEK_CUR);
+ else
+ return file->position - file->buff_len + file->buff_ind;
}