GNOME Bugzilla – Bug 152844
http seek to eof yields really silly results
Last modified: 2004-12-22 21:47:04 UTC
With the little patch below, things fail badly from the seek of that seek and going forward. wget http://jk.ufisa.uninett.no/gnumeric/colwidth.xls ./test-seek http://jk.ufisa.uninett.no/gnumeric/colwidth.xls colwidth.xls ** (process:12670): WARNING **: read failure: vfs read 69724 and fread 0 bytes ('Generic error') ** (process:12670): WARNING **: read failure: vfs read 69724 and fread 466 bytes ('Generic error') ** (process:12670): WARNING **: Offset mismatch 719 should be 1185 ** (process:12670): WARNING **: Offset mismatch 719 should be 1185 ** (process:12670): WARNING **: Offset mismatch 719 should be 1185 --- test-seek.c.~1.4.~ 2004-09-16 15:16:08.000000000 -0400 +++ test-seek.c 2004-09-16 15:16:29.000000000 -0400 @@ -217,6 +217,12 @@ GnomeVFSFileOffset seekpos = (1000.0 * rand () / (RAND_MAX + 1.0)); GnomeVFSSeekPosition w = (int)(2.0 * rand () / (RAND_MAX + 1.0)); + if (i == 0) { + length = 0; + seekpos = 0; + w = GNOME_VFS_SEEK_END; + } + if (!seek_test_chunk (handle, ref, seekpos, w, length)) { printf ("Failed: seek (offset %d, whence '%s'), read (length %d), tell = %ld\n", (int)seekpos, translate_vfs_seek_pos (w, NULL),
While this looks like a technicality it actually breaks OLE2 reading in libgsf and thus xls loading in gnumeric. Presumably it hits abiword too.
I'll look at it the the weekend. Thanks!
I think it's a dupe of #153153, please reopen if I'm mistaken. *** This bug has been marked as a duplicate of 153153 ***