diff --git a/scsh/scsh.scm b/scsh/scsh.scm index 37815dc..dc72cd1 100644 --- a/scsh/scsh.scm +++ b/scsh/scsh.scm @@ -1139,11 +1139,14 @@ proc)) (define (exit . maybe-status) - (call-exit-hooks-and-narrow - (lambda () - (exit/errno (:optional maybe-status 0)) - (display "The evil undead walk the earth." 2) - (if #t (error "(exit) returned."))))) + (let ((status (:optional maybe-status 0))) + (if (not (integer? status)) + (error "non-integer argument to exit")) + (call-exit-hooks-and-narrow + (lambda () + (exit/errno status) + (display "The evil undead walk the earth." 2) + (if #t (error "(exit) returned.")))))) ;;; The classic T 2.0 primitive.