7ab5fb10b858e5ffdc8e36934537123849265b62 kent Mon Jun 9 12:55:40 2014 -0700 Removing an optimization for short seeks in lineFileSeek that was breaking in most cases. diff --git src/lib/linefile.c src/lib/linefile.c index 028946f..954cde3 100644 --- src/lib/linefile.c +++ src/lib/linefile.c @@ -367,42 +367,34 @@ void lineFileSeek(struct lineFile *lf, off_t offset, int whence) /* Seek to read next line from given position. */ { noTabixSupport(lf, "lineFileSeek"); if (lf->checkSupport) lf->checkSupport(lf, "lineFileSeek"); if (lf->pl != NULL) errnoAbort("Can't lineFileSeek on a compressed file: %s", lf->fileName); lf->reuse = FALSE; if (lf->udcFile) { udcSeek(lf->udcFile, offset); return; } -if (whence == SEEK_SET && offset >= lf->bufOffsetInFile - && offset < lf->bufOffsetInFile + lf->bytesInBuf) - { - lf->lineStart = lf->lineEnd = offset - lf->bufOffsetInFile; - } -else - { lf->lineStart = lf->lineEnd = lf->bytesInBuf = 0; if ((lf->bufOffsetInFile = lseek(lf->fd, offset, whence)) == -1) errnoAbort("Couldn't lineFileSeek %s", lf->fileName); } -} void lineFileRewind(struct lineFile *lf) /* Return lineFile to start. */ { lineFileSeek(lf, 0, SEEK_SET); lf->lineIx = 0; } int lineFileLongNetRead(int fd, char *buf, int size) /* Keep reading until either get no new characters or * have read size */ { int oneSize, totalRead = 0; while (size > 0)