0.9.13.20:
authorJuho Snellman <jsnell@iki.fi>
Thu, 1 Jun 2006 12:01:18 +0000 (12:01 +0000)
committerJuho Snellman <jsnell@iki.fi>
Thu, 1 Jun 2006 12:01:18 +0000 (12:01 +0000)
Merge sbcl-devel patch "NAME-CHAR and unrecognised symbols" by
        Robert J. Macomber, fixing an issue with NAME-CHAR signaling an error
        when given an invalid symbol.

NEWS
src/code/target-char.lisp
tests/character.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 20abf71..07b2e1a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ changes in sbcl-0.9.14 relative to sbcl-0.9.13:
   * bug fix: saving large (>2GB) cores on x86-64 now works
   * bug fix: a x86-64 backend bug when compiling (setf aref) with a 
     constant index and a (simple-array (signed-byte 32)) array
+  * bug fix: NAME-CHAR on an invalid symbol no longer signals an
+    error (patch by Robert J. Macomber)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** MISC.641: LET-conversion were not supposed to work in late
        compilation stages.
index 18ea349..7f963b8 100644 (file)
       (let ((encoding (huffman-encode (string-upcase name)
                                        *unicode-character-name-huffman-tree*)))
         (when encoding
-          (let ((char-code
-                 (car (binary-search encoding
-                                     (cdr *unicode-character-name-database*)
-                                     :key #'cdr)))
-                (name-length (length name)))
+          (let* ((char-code
+                  (car (binary-search encoding
+                                      (cdr *unicode-character-name-database*)
+                                      :key #'cdr)))
+                 (name-string (string name))
+                 (name-length (length name-string)))
             (cond
               (char-code
                (code-char char-code))
               ((and (or (= name-length 9)
                         (= name-length 5))
-                    (char-equal (char name 0) #\U)
+                    (char-equal (char name-string 0) #\U)
                     (loop for i from 1 below name-length
-                          always (digit-char-p (char name i) 16)))
-               (code-char (parse-integer name :start 1 :radix 16)))
+                          always (digit-char-p (char name-string i) 16)))
+               (code-char (parse-integer name-string :start 1 :radix 16)))
               (t
                nil)))))))
 \f
index 56e899d..37f4b49 100644 (file)
@@ -71,3 +71,5 @@
          (name (char-name char)))
     (unless graphicp
       (assert name))))
+
+(assert (null (name-char 'foo)))
index f8f6799..4eb4da5 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.13.19"
+"0.9.13.20"