From: Martin Mares Date: Wed, 14 Sep 2005 11:48:32 +0000 (+0000) Subject: If nothing has been written, brewind() needn't flush. X-Git-Tag: holmes-import~738 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c35c94cc25dfbae4c91edb388d1875ffdf58ca59;p=libucw.git If nothing has been written, brewind() needn't flush. --- diff --git a/lib/fastbuf.c b/lib/fastbuf.c index 6fbb2184..59a923ba 100644 --- a/lib/fastbuf.c +++ b/lib/fastbuf.c @@ -1,7 +1,7 @@ /* * UCW Library -- Fast Buffered I/O * - * (c) 1997--2004 Martin Mares + * (c) 1997--2005 Martin Mares * * 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); }