From c35c94cc25dfbae4c91edb388d1875ffdf58ca59 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 14 Sep 2005 11:48:32 +0000 Subject: [PATCH] If nothing has been written, brewind() needn't flush. --- lib/fastbuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.39.2