mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix with-locale*' in
(test-suite lib)'.
* test-suite/lib.scm (with-locale*): Set LOC to the previous locale name, not to the new locale name. Only restore LOC when it's not #f. (with-locale): Use `syntax-rules'.
This commit is contained in:
parent
54096be752
commit
f5147c84a2
1 changed files with 8 additions and 6 deletions
|
@ -456,19 +456,21 @@ with-locale with-locale*
|
|||
(lambda ()
|
||||
(if (defined? 'setlocale)
|
||||
(begin
|
||||
(set! loc
|
||||
(false-if-exception (setlocale LC_ALL nloc)))
|
||||
(if (not loc)
|
||||
(set! loc (false-if-exception (setlocale LC_ALL)))
|
||||
(if (or (not loc)
|
||||
(not (false-if-exception (setlocale LC_ALL nloc))))
|
||||
(throw 'unresolved)))
|
||||
(throw 'unresolved)))
|
||||
thunk
|
||||
(lambda ()
|
||||
(if (defined? 'setlocale)
|
||||
(if (and (defined? 'setlocale) loc)
|
||||
(setlocale LC_ALL loc))))))
|
||||
|
||||
;;; Evaluate BODY... using the given locale.
|
||||
(define-macro (with-locale loc . body)
|
||||
`(with-locale* ,loc (lambda () ,@body)))
|
||||
(define-syntax with-locale
|
||||
(syntax-rules ()
|
||||
((_ loc body ...)
|
||||
(with-locale* loc (lambda () body ...)))))
|
||||
|
||||
|
||||
;;;; REPORTERS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue