CMUCL commit: src/pcl/simple-streams/external-formats (utf-16.lisp)

Raymond Toy rtoy at common-lisp.net
Fri Aug 13 03:48:44 CEST 2010


    Date: Thursday, August 12, 2010 @ 21:48:44
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/pcl/simple-streams/external-formats

Modified: utf-16.lisp

In FLUSH-STATE, only flush something if the state has something to be
flushed.


-------------+
 utf-16.lisp |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)


Index: src/pcl/simple-streams/external-formats/utf-16.lisp
diff -u src/pcl/simple-streams/external-formats/utf-16.lisp:1.12 src/pcl/simple-streams/external-formats/utf-16.lisp:1.13
--- src/pcl/simple-streams/external-formats/utf-16.lisp:1.12	Mon Jul 12 10:42:11 2010
+++ src/pcl/simple-streams/external-formats/utf-16.lisp	Thu Aug 12 21:48:44 2010
@@ -1,7 +1,7 @@
 ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: STREAM -*-
 ;;;
 ;;; **********************************************************************
-(ext:file-comment "$Header: /project/cmucl/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.12 2010-07-12 14:42:11 rtoy Exp $")
+(ext:file-comment "$Header: /project/cmucl/cvsroot/src/pcl/simple-streams/external-formats/utf-16.lisp,v 1.13 2010-08-13 01:48:44 rtoy Exp $")
 
 (in-package "STREAM")
 (intl:textdomain "cmucl")
@@ -126,13 +126,14 @@
 	      (,output (ldb (byte 8 8) code))
 	      (,output (ldb (byte 8 0) code))))
        (let ((,c (car ,state)))
-	 (out (if (lisp::surrogatep ,c)
-		  (if ,error
-		      (funcall ,error
-			       "Flushing bare surrogate #x~4,'0X is illegal for UTF-16"
-			       (char-code ,c))
-		      +replacement-character-code+)
-		  ,c)))))
+	 (when ,c
+	   (out (if (lisp::surrogatep ,c)
+		    (if ,error
+			(funcall ,error
+				 "Flushing bare surrogate #x~4,'0X is illegal for UTF-16"
+				 (char-code ,c))
+			+replacement-character-code+)
+		    ,c))))))
   (copy-state (state)
     ;; The state is list. Copy it
     `(copy-list ,state)))



More information about the cmucl-commit mailing list