changeset 3087:f333e6df5fa9

ungetc(): trash the stack of ungetc()'d chars if a seek is made
author William Pitcock <nenolod@atheme.org>
date Wed, 29 Apr 2009 21:12:44 -0500
parents 1090853873d2
children 27e2dbb89226
files src/gio/gio.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gio/gio.c	Wed Apr 29 21:02:33 2009 -0500
+++ b/src/gio/gio.c	Wed Apr 29 21:12:44 2009 -0500
@@ -203,6 +203,12 @@
     if (!g_seekable_can_seek(handle->seekable))
         return -1;
 
+    if (handle->stream_stack != NULL)
+    {
+        g_slist_free(handle->stream_stack);
+        handle->stream_stack = NULL;
+    }
+
     switch (whence)
     {
     case SEEK_CUR: