]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.4-1 (r304)
authorHeng Li <lh3@live.co.uk>
Thu, 28 May 2009 10:08:49 +0000 (10:08 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 28 May 2009 10:08:49 +0000 (10:08 +0000)
 * fixed a minor bug in printing headers

bamtk.c
sam.c

diff --git a/bamtk.c b/bamtk.c
index 5dfa82a5142baaf0aecddc92501788d2891f64a5..9b3aae1132c8b7fdf801b20e2bc9929d074d5aa4 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -3,7 +3,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.4 (r297)"
+#define PACKAGE_VERSION "0.1.4-1 (r304)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);
diff --git a/sam.c b/sam.c
index 671b5042bc17ec1948c83fe54093c03ff7065120..8411d81f0af8b19e04cc1ffc77e1f741efd6987b 100644 (file)
--- a/sam.c
+++ b/sam.c
@@ -67,10 +67,10 @@ samfile_t *samopen(const char *fn, const char *mode, const void *aux)
                                sam_header_parse(alt);
                                alt->l_text = 0; alt->text = 0;
                                // check if there are @SQ lines in the header
+                               fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw);
                                if (alt->n_targets) { // then write the header text without dumping ->target_{name,len}
                                        if (alt->n_targets != fp->header->n_targets)
                                                fprintf(stderr, "[samopen] inconsistent number of target sequences.\n");
-                                       fwrite(fp->header->text, 1, fp->header->l_text, fp->x.tamw);
                                } else { // then dump ->target_{name,len}
                                        for (i = 0; i < fp->header->n_targets; ++i)
                                                fprintf(fp->x.tamw, "@SQ\tSN:%s\tLN:%d\n", fp->header->target_name[i], fp->header->target_len[i]);