From 84df3910a549b8321321fd561b9d0f9b1ac771d3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 5 Aug 2016 14:42:13 -0700 Subject: [PATCH] edwin/process.scm (poll-process-for-output): allow for reading #f --- src/edwin/process.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/edwin/process.scm b/src/edwin/process.scm index 4f5bbf633..e19a40f6b 100644 --- a/src/edwin/process.scm +++ b/src/edwin/process.scm @@ -249,13 +249,14 @@ Initialized from the SHELL environment variable." (call-with-current-continuation (lambda (k) (bind-condition-handler (list condition-type:port-error) - (lambda (condition) condition (k #t)) + (lambda (condition) condition (k 'ERROR)) (lambda () (input-port/read-string! port input-buffer))))))) - (if (or (not (fixnum? n)) - (fix:= n 0)) + (if (or (eq? 'ERROR n) + (and (fixnum? n) (fix:= n 0))) (close-port port) - (output-substring process input-buffer n)) + (if (and (fixnum? n) (fix:> n 0)) + (output-substring process input-buffer n))) (and (fixnum? n) (fix:> n 0)))))) -- 2.25.1