Index: subversion/libsvn_subr/io.c =================================================================== --- subversion/libsvn_subr/io.c (revision 1382102) +++ subversion/libsvn_subr/io.c (working copy) @@ -3443,7 +3443,11 @@ apr_size_t to_read = buf_size < 129 ? buf_size - 1 : 128; apr_size_t bytes_read = 0; char *eol; + apr_off_t starting_offset = 0; + /* Remember the starting offset. */ + SVN_ERR(svn_io_file_seek(file, APR_CUR, &starting_offset, pool)); + /* read data block (or just a part of it) */ SVN_ERR(svn_io_file_read_full2(file, buf, to_read, &bytes_read, &eof, pool)); @@ -3453,16 +3457,15 @@ eol = strchr(buf, '\n'); if (eol) { - apr_off_t offset = (eol + 1 - buf) - bytes_read; - + apr_off_t offset = starting_offset + eol + 1 - buf; + *eol = 0; *limit = total_read + (eol - buf); /* correct the file pointer: * appear as though we just had read the newline char */ - SVN_ERR(svn_io_file_seek(file, APR_CUR, &offset, pool)); - + SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool)); return SVN_NO_ERROR; } else if (eof)