]> git.donarmstrong.com Git - samtools.git/commitdiff
Release samtools-0.1.5c (fixed a bug in piping)
authorHeng Li <lh3@live.co.uk>
Tue, 7 Jul 2009 15:53:29 +0000 (15:53 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 7 Jul 2009 15:53:29 +0000 (15:53 +0000)
bamtk.c
knetfile.c

diff --git a/bamtk.c b/bamtk.c
index 536924c6c1d924795d52b282e2f711fe9828573a..3386836e04e3a0b44eb47ff9d925d0db20b8ea90 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -4,7 +4,7 @@
 #include "bam.h"
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.5b (r383)"
+#define PACKAGE_VERSION "0.1.5c (r385)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);
index 12dc2d17af733d2c5bb93870a3285833fdb063cd..cef197dd08b0b29e97be7a3dade6cac54d244c46 100644 (file)
@@ -226,7 +226,12 @@ off_t knet_read(knetFile *fp, void *buf, off_t len)
        off_t l = 0;
        if (fp->fd < 0) return 0;
        if (fp->type == KNF_TYPE_LOCAL) {
-               l = read(fp->fd, buf, len);
+               off_t rest = len, curr;
+               while (rest) {
+                       curr = read(fp->fd, buf + l, rest);
+                       if (curr == 0) break;
+                       l += curr; rest -= curr;
+               }
                fp->offset += l;
        } else {
                off_t rest = len, curr;