[physfs] PHYSFS_seek/tell with buffered data
Ryan C. Gordon
icculus at clutteredmind.org
Tue Jan 28 13:21:40 EST 2003
> if(h->buffer != NULL)
> h->buffill = h->bufpos = h->bufsize;
> just before the return in PHYSFS_seek. This makes is work just fine.
> Although I'm new to PhysFS, this seems like a bug to me. I'm surprised
> no one else has picked this up before, so am just wondering if I'm
> wrong in assuming that PHYSFS_tell(PHYSFS_filelength(handle)) should
> always return PHYSFS_filelength(handle).
It's a bug, since the buffering code was just added. I've put a similar
fix into CVS, now.
However, PHYSFS_tell() takes a (PHYSFS_file *), not a number (what is
returned from PHYFS_filelength()), so I'm amazed that compiles at all, and
doesn't crash if it does build.
More information about the physfs