From eabf188d000d5cdb8139f7a5332b8d7faa432ab1 Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 30 May 2018 10:55:50 +0200 Subject: [PATCH] chicken-uninstall: show helpful msg when asking for confirmation and stdin is EOF --- chicken-uninstall.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm index bc5e2aa..6a692c8 100644 --- a/chicken-uninstall.scm +++ b/chicken-uninstall.scm @@ -85,10 +85,13 @@ (let loop () (display "Do you want to proceed? (yes/no) ") (flush-output) - (let ((r (trim (read-line)))) - (cond ((string=? r "yes")) - ((string=? r "no") (fini 1)) - (else (loop)))))) + (let ((a (read-line))) + (when (eof-object? a) + (error "EOF - use `-force' to proceed anyway")) + (let ((r (trim a))) + (cond ((string=? r "yes")) + ((string=? r "no") (fini 1)) + (else (loop))))))) (define (trim str) (define (left lst) -- 1.7.9.5