mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Gracefully handle `setlocale' errors at the REPL.
* module/ice-9/top-repl.scm (top-repl): Catch exceptions from `setlocale'. Reported by CRLF0710 <crlf0710@gmail.com>.
This commit is contained in:
parent
fb9cfa83a7
commit
94b55d3fa0
1 changed files with 8 additions and 1 deletions
|
@ -65,7 +65,14 @@
|
||||||
(call-with-sigint
|
(call-with-sigint
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(and (defined? 'setlocale)
|
(and (defined? 'setlocale)
|
||||||
|
(catch 'system-error
|
||||||
|
(lambda ()
|
||||||
(setlocale LC_ALL ""))
|
(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)))
|
(let ((status (start-repl 'scheme)))
|
||||||
(run-hook exit-hook)
|
(run-hook exit-hook)
|
||||||
status)))))
|
status)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue