From: Heng Li Date: Wed, 17 Jun 2009 23:16:26 +0000 (+0000) Subject: * samtools-0.1.4-13 (r351) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9348942203fc319b5322d473726d1820341c6483;p=samtools.git * samtools-0.1.4-13 (r351) * make faidx more tolerant to empty lines right before or after > lines * hope this does not introduce new bugs... --- diff --git a/bamtk.c b/bamtk.c index b5afdf2..6c4626a 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.4-13 (r350)" +#define PACKAGE_VERSION "0.1.4-14 (r351)" #endif int bam_taf2baf(int argc, char *argv[]); diff --git a/faidx.c b/faidx.c index 9302dfb..6b4514f 100644 --- a/faidx.c +++ b/faidx.c @@ -66,6 +66,12 @@ faidx_t *fai_build_core(RAZF *rz) name = 0; l_name = m_name = 0; len = line_len = line_blen = -1; state = 0; l1 = l2 = -1; offset = 0; while (razf_read(rz, &c, 1)) { + if (c == '\n') { // an empty line + if (state == 1) { + offset = razf_tell(rz); + continue; + } else if ((state == 0 && len < 0) || state == 2) continue; + } if (c == '>') { // fasta header if (len >= 0) fai_insert_index(idx, name, len, line_len, line_blen, offset);