]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.c
Added special mode for sorting of regular files.
[libucw.git] / lib / fastbuf.c
index 50b869a88ff39b086f5e09a952703f7ddb494a48..0929f101a9c8a959bda89abe1c892711fe643051 100644 (file)
@@ -314,14 +314,19 @@ bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uns l)
 
       favail = bdirect_read_prepare(f, &fptr);
       if (!favail)
-       die("bbcopy: source exhausted");
+       {
+         if (l == ~0U)
+           return;
+         die("bbcopy: source exhausted");
+       }
       tavail = bdirect_write_prepare(t, &tptr);
       n = MIN(l, favail);
       n = MIN(n, tavail);
       memcpy(tptr, fptr, n);
       bdirect_read_commit(f, fptr + n);
       bdirect_write_commit(t, tptr + n);
-      l -= n;
+      if (l != ~0U)
+       l -= n;
     }
 }