1.0.23.2: STRING->UTF8 did not handle the start argument correctly
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:28:35 +0000 (15:28 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:28:35 +0000 (15:28 +0000)
 * Thank to Luis Oliveira.

NEWS
src/code/octets.lisp
tests/octets.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 598227b..69e84d9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 ;;;; -*- coding: utf-8; -*-
   * bug fix: lexical type declarations are now correctly reported by
     SB-CLTL2. (reported by Larry D'Anna)
+  * bug fix: STRING-TO-OCTETS did not handle :START properly when
+    using UTF-8 as external format. (thanks to Luis Oliveira)
 
 changes in sbcl-1.0.23 relative to 1.0.22:
   * enhancement: when disassembling method functions, disassembly
index eb87cd1..32344cc 100644 (file)
@@ -402,8 +402,9 @@ one-past-the-end"
   (macrolet ((ascii-bash ()
                '(let ((array (make-array (+ null-padding (- send sstart))
                                          :element-type '(unsigned-byte 8))))
-                 (loop for i from sstart below send
-                       do (setf (aref array i) (char-code (char string i))))
+                 (loop for i from 0
+                       and j from sstart below send
+                       do (setf (aref array i) (char-code (char string j))))
                  array)))
     (etypecase string
       ((simple-array character (*))
index f0d5dba..166d01b 100644 (file)
   )
 
 )
+
+;; regression test: STRING->UTF8 didn't properly handle a non-zero
+;; START argument.
+(assert (equalp #(50) (string-to-octets "42" :start 1 :external-format :utf-8)))
index 08cc696..d4b8998 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".)
-"1.0.23.1"
+"1.0.23.2"