]> mj.ucw.cz Git - libucw.git/commitdiff
Let bskip() return success.
authorMartin Mares <mj@ucw.cz>
Mon, 27 Sep 2004 19:49:00 +0000 (19:49 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 27 Sep 2004 19:49:00 +0000 (19:49 +0000)
lib/fastbuf.c
lib/fastbuf.h

index 85df8250370f10197234d902f4cbcc908fd73895..a29dc30b370e8a5c2606eab15edb665b9746bbbb 100644 (file)
@@ -343,17 +343,20 @@ brewind(struct fastbuf *f)
   bsetpos(f, 0);
 }
 
-void
+int
 bskip(struct fastbuf *f, uns len)
 {
   while (len)
     {
       byte *buf;
       uns l = bdirect_read_prepare(f, &buf);
+      if (!l)
+       return 0;
       l = MIN(l, len);
       bdirect_read_commit(f, buf+l);
       len -= l;
     }
+  return 1;
 }
 
 sh_off_t
index 25c11d70e0d2aaed6bf38b13cdd41b2d29ebd189..777630c8b92d146c265cb4455d50a0bbe77fc312 100644 (file)
@@ -122,7 +122,7 @@ void bflush(struct fastbuf *f);
 void bseek(struct fastbuf *f, sh_off_t pos, int whence);
 void bsetpos(struct fastbuf *f, sh_off_t pos);
 void brewind(struct fastbuf *f);
-void bskip(struct fastbuf *f, uns len);
+int bskip(struct fastbuf *f, uns len);
 sh_off_t bfilesize(struct fastbuf *f);
 
 static inline sh_off_t btell(struct fastbuf *f)