You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/10/14 04:54:12 UTC
svn commit: r584482 - /apr/apr/branches/1.2.x/file_io/win32/seek.c
Author: wrowe
Date: Sat Oct 13 19:54:11 2007
New Revision: 584482
URL: http://svn.apache.org/viewvc?rev=584482&view=rev
Log:
Fix bug identified by testlfs; Win32 didn't handle buffered
files >size_t bytes (we cast-truncated at the wrong spot).
Backport: 584480
Modified:
apr/apr/branches/1.2.x/file_io/win32/seek.c
Modified: apr/apr/branches/1.2.x/file_io/win32/seek.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/win32/seek.c?rev=584482&r1=584481&r2=584482&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/seek.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/seek.c Sat Oct 13 19:54:11 2007
@@ -21,7 +21,7 @@
static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
{
- apr_size_t newbufpos;
+ apr_off_t newbufpos;
apr_status_t rv;
DWORD rc;
@@ -37,8 +37,7 @@
/* We may be truncating to size here.
* XXX: testing an 'unsigned' as >= 0 below indicates a bug
*/
- newbufpos = (apr_size_t)(pos - (thefile->filePtr
- - thefile->dataRead));
+ newbufpos = pos - (thefile->filePtr - thefile->dataRead);
if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
thefile->bufpos = (apr_size_t)newbufpos;