Changeset 13893 in project


Ignore:
Timestamp:
03/24/09 17:41:51 (11 years ago)
Author:
Kon Lovett
Message:

Fix for out-of-scope lc in gnu language. Added defaults to categories refs.

Location:
release/3/locale/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/locale/trunk/locale-categories.scm

    r13886 r13893  
    5252;; A locale-component or #f
    5353
    54 (define (locale-dictionary-category rec key)
     54(define (locale-dictionary-category rec key #!optional def)
    5555  (check-locale-dictionary 'locale-dictionary-category rec)
    5656  (check-symbol 'locale-dictionary-category key)
    57         (dict-ref (locale-dictionary-table rec) key) )
     57        (dict-ref (locale-dictionary-table rec) key def) )
    5858
    5959;;;
     
    7575;; A locale-component or #f
    7676
    77 (define (locale-category-ref what)
    78         (locale-dictionary-category (current-locale-dictionary) what) )
     77(define (locale-category-ref what #!optional def)
     78        (locale-dictionary-category (current-locale-dictionary) what def) )
  • release/3/locale/trunk/locale-posix.scm

    r13886 r13893  
    212212    (let ((lc (make-locale-components str src tag)))
    213213      (cond ((or (string=? str "C") (string=? str "POSIX"))
    214               lc )
     214              #f )
    215215            ((string-prefix? "/" str)
    216216              (parse-posix-pathname-locale lc str) )
     
    245245(define (gnu-language-string->locale-components str . args)
    246246  (let-optionals args ((src "GNU") (tag 'language))
    247     (let ((lc (make-locale-components str src tag))
    248           (lst
    249             (map
    250              (lambda (lclstr)
    251                (let ((rlc (posix-locale-string->locale-components lclstr src)))
    252                  (set-locale-component! rlc
    253                   'region (string-upcase (locale-component-ref lc 'language)))
    254                  rlc ) )
    255              (string-split str ":"))))
    256       (update-locale-components! lc 'locales lst)
     247    (let* ((lc (make-locale-components str src tag))
     248           (lang (string-upcase (locale-component-ref lc 'language))))
     249      (update-locale-components! lc 'locales
     250       (map
     251        (lambda (str)
     252          (let ((rlc (posix-locale-string->locale-components str src)))
     253            (set-locale-component! rlc 'region lang)
     254            rlc ) )
     255        (string-split str ":")))
    257256      lc ) ) )
    258257
Note: See TracChangeset for help on using the changeset viewer.