summaryrefslogtreecommitdiffstats
path: root/util/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-02-13 21:58:50 +0100
committerWerner Koch <wk@gnupg.org>1998-02-13 21:58:50 +0100
commitf477447d9af4097e8c5d4c15a3dd381237e93ee2 (patch)
treea655392c92fed02f06ebf503bf10b835b56e54e0 /util/iobuf.c
parentadded assembler stuff for hppa (diff)
downloadgnupg2-f477447d9af4097e8c5d4c15a3dd381237e93ee2.tar.xz
gnupg2-f477447d9af4097e8c5d4c15a3dd381237e93ee2.zip
added option exportV0-2-6
Diffstat (limited to 'util/iobuf.c')
-rw-r--r--util/iobuf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/iobuf.c b/util/iobuf.c
index 65efc0ef5..cc3288d7e 100644
--- a/util/iobuf.c
+++ b/util/iobuf.c
@@ -867,6 +867,11 @@ iobuf_tell( IOBUF a )
}
+
+/****************
+ * This is a very limited implementation. It simply discards all internal
+ * buffering and remove all filters but the first one.
+ */
int
iobuf_seek( IOBUF a, ulong newpos )
{
@@ -885,6 +890,10 @@ iobuf_seek( IOBUF a, ulong newpos )
log_error("can't seek to %lu: %s\n", newpos, strerror(errno) );
return -1;
}
+ a->d.len = 0; /* discard buffer */
+ a->d.start = 0;
+ a->nbytes = 0;
+ a->nlimit = 0;
a->ntotal = newpos;
/* remove filters, but the last */
while( a->chain )