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



that looks like a very strange way of achieving what you want; this looks like a better change..?
diff -u -p -r1.142 lisp.c
--- lisp.c      20 Jan 2005 06:44:59 -0000      1.142
+++ lisp.c      6 Feb 2005 19:43:02 -0000
@@ -2493,7 +2493,7 @@ handler.
     rep_DECLARE1(error, rep_SYMBOLP);
     on_error = Fsymbol_value (Qbacktrace_on_error, Qt);
-    if (on_error == Qt
+    if ((on_error == Qt && error != Qend_of_stream)
        || (rep_CONSP(on_error)
            && (tmp = Fmemq (error, on_error)) && tmp != Qnil))
     {
@@ -2504,7 +2504,7 @@ handler.
     errlist = Fcons(error, data);
     on_error = Fsymbol_value(Qdebug_on_error, Qt);
-    if(((on_error != rep_NULL && on_error == Qt)
+ if(((on_error != rep_NULL && on_error == Qt && error != Qend_of_stream)
        || (rep_CONSP(on_error)
            && (tmp = Fmemq(error, on_error)) && !rep_NILP(tmp))))
     {
On Feb 3, 2005, at 1:40 PM, Michal Maruška wrote:
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]