[template-glib] input-stream: be more relaxed about end of file



commit 42c94ca3cf96fa437008c56a066b1a7a6a11ad28
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 23 14:01:04 2017 -0700

    input-stream: be more relaxed about end of file
    
    When we fail to read a byte, we probably just reached the end
    of the stream since we succeeded at reading-ahead above.

 src/tmpl-token-input-stream.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/tmpl-token-input-stream.c b/src/tmpl-token-input-stream.c
index 551f5ee..bf70f37 100644
--- a/src/tmpl-token-input-stream.c
+++ b/src/tmpl-token-input-stream.c
@@ -244,11 +244,9 @@ tmpl_token_input_stream_read_token (TmplTokenInputStream  *self,
    */
   ch = g_data_input_stream_read_byte (stream, cancellable, &local_error);
 
-  if ((ch == 0) && (local_error != NULL))
-    {
-      g_propagate_error (error, local_error);
-      return NULL;
-    }
+  /* Probably just end of file */
+  if (ch == 0)
+    return NULL;
 
   /*
    * Handle possible escaped \{.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]