]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.4-13 (r351)
authorHeng Li <lh3@live.co.uk>
Wed, 17 Jun 2009 23:16:26 +0000 (23:16 +0000)
committerHeng Li <lh3@live.co.uk>
Wed, 17 Jun 2009 23:16:26 +0000 (23:16 +0000)
 * make faidx more tolerant to empty lines right before or after > lines
 * hope this does not introduce new bugs...

bamtk.c
faidx.c

diff --git a/bamtk.c b/bamtk.c
index b5afdf284c67145ef45813540900075f273f8f0b..6c4626aec3ce3e7160b2294f833361d819970e4d 100644 (file)
--- 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 9302dfb4d6480bb94295d65e7fc7fcf4c4644332..6b4514ffa2f24946bdfed2228c8044cd8268e692 100644 (file)
--- 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);