mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +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 ()
|
(lambda ()
|
||||||
(if (defined? 'setlocale)
|
(if (defined? 'setlocale)
|
||||||
(begin
|
(begin
|
||||||
(set! loc
|
(set! loc (false-if-exception (setlocale LC_ALL)))
|
||||||
(false-if-exception (setlocale LC_ALL nloc)))
|
(if (or (not loc)
|
||||||
(if (not loc)
|
(not (false-if-exception (setlocale LC_ALL nloc))))
|
||||||
(throw 'unresolved)))
|
(throw 'unresolved)))
|
||||||
(throw 'unresolved)))
|
(throw 'unresolved)))
|
||||||
thunk
|
thunk
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(if (defined? 'setlocale)
|
(if (and (defined? 'setlocale) loc)
|
||||||
(setlocale LC_ALL loc))))))
|
(setlocale LC_ALL loc))))))
|
||||||
|
|
||||||
;;; Evaluate BODY... using the given locale.
|
;;; Evaluate BODY... using the given locale.
|
||||||
(define-macro (with-locale loc . body)
|
(define-syntax with-locale
|
||||||
`(with-locale* ,loc (lambda () ,@body)))
|
(syntax-rules ()
|
||||||
|
((_ loc body ...)
|
||||||
|
(with-locale* loc (lambda () body ...)))))
|
||||||
|
|
||||||
|
|
||||||
;;;; REPORTERS
|
;;;; REPORTERS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue