]> mj.ucw.cz Git - libucw.git/commitdiff
If nothing has been written, brewind() needn't flush.
authorMartin Mares <mj@ucw.cz>
Wed, 14 Sep 2005 11:48:32 +0000 (11:48 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 14 Sep 2005 11:48:32 +0000 (11:48 +0000)
lib/fastbuf.c

index 6fbb2184ca2d0a90a0135ab012e248db3e09fec1..59a923ba485761d22d9d829b82f9ef83b7e40f27 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Fast Buffered I/O
  *
- *     (c) 1997--2004 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2005 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -339,7 +339,8 @@ bconfig(struct fastbuf *f, uns item, int value)
 void
 brewind(struct fastbuf *f)
 {
-  bflush(f);
+  if (f->bptr > f->bstop)
+    bflush(f);
   bsetpos(f, 0);
 }