librep: end-of-file is not an error worth showing backtrace.




i use (in sawfish) backtrace-on-error (set to #t). But eof is apparently
treated as an error, later `fixed'. This is my quick fix:




--- /p/librep-0.17.old/work/librep-0.17/src/streams.c	2002-02-19 06:33:53.000000000 +0100
+++ librep-0.17/src/streams.c	2005-02-03 22:09:07.000000000 +0100
@@ -738,6 +738,13 @@
     /* If an error occurred leave stream where it is.  */
     if (res && c != EOF)
 	rep_stream_ungetc (stream, c);
+    else
+       {
+          if (! res)
+             {
+                res = Fsignal (Qend_of_stream, rep_LIST_1(stream));
+             }
+       };
     return res;
 }
 
--- /p/librep-0.17.old/work/librep-0.17/src/lisp.c	2005-02-03 22:18:58.000000000 +0100
+++ librep-0.17/src/lisp.c	2005-02-03 22:10:55.000000000 +0100
@@ -1111,7 +1111,10 @@
     /* not reached */
 
 eof:
+    if (end_of_stream_error == Qpremature_end_of_stream)
     return signal_reader_error (end_of_stream_error, rep_LIST_1(strm), 0);
+    else 
+       return NULL;             /* rep_NULL */
 }
 
 repv



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