[FIX] stop crashing in case of invalid input in the shell - clic - Clic is an command line interactive client for gopher written in Common LISP
(HTM) git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/clic/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 2becc58109286c9eede222bd3595ab580b76dfea
(DIR) parent 16c4a85655da1d9cc8a9dd2dadd15e563b7546de
(HTM) Author: Solene Rapenne <solene@perso.pw>
Date: Sat, 4 Nov 2017 16:17:18 +0000
[FIX] stop crashing in case of invalid input in the shell
Diffstat:
M clic.lisp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/clic.lisp b/clic.lisp
@@ -203,7 +203,9 @@
(format t "clic => ")
(force-output)
(loop for user-input = (format nil "~a" (read nil nil))
- while (not (string= "X" user-input))
+ while (not (or
+ (string= "X" user-input)
+ (string= "Q" user-input)))
do
(cond
((string= "HELP" user-input)
@@ -213,7 +215,7 @@
((string= "H" user-input)
(format t "~{~a~%~}" *history*))
(t
- (when user-input
+ (ignore-errors
(g (parse-integer user-input)))))
(format t "clic => ")
(force-output)))