From: Ludovic Courtès Date: Tue, 26 Apr 2011 22:57:16 +0000 (+0200) Subject: Gracefully handle `setlocale' errors at the REPL. X-Git-Tag: v2.0.1~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94b55d3fa046523e13de9df1c2fb39280f4842e8;p=platform%2Fupstream%2Fguile.git Gracefully handle `setlocale' errors at the REPL. * module/ice-9/top-repl.scm (top-repl): Catch exceptions from `setlocale'. Reported by CRLF0710 . --- diff --git a/module/ice-9/top-repl.scm b/module/ice-9/top-repl.scm index 64c023997..d43436c4a 100644 --- a/module/ice-9/top-repl.scm +++ b/module/ice-9/top-repl.scm @@ -65,7 +65,14 @@ (call-with-sigint (lambda () (and (defined? 'setlocale) - (setlocale LC_ALL "")) + (catch 'system-error + (lambda () + (setlocale LC_ALL "")) + (lambda (key subr fmt args errno) + (format (current-error-port) + "warning: failed to install locale: ~a~%" + (strerror (car errno)))))) + (let ((status (start-repl 'scheme))) (run-hook exit-hook) status)))))