shithub: femtolisp

Download patch

ref: b2d65487156e87c7af8ab5ed6d41d78524bed22b
parent: 4e5319a7dcb0e7f68dfdb6e6516b4242191ed38e
author: Jeff Bezanson <jeff.bezanson@gmail.com>
date: Sat Aug 19 10:18:32 EDT 2017

fix bug in printing the character #\x0

--- a/print.c
+++ b/print.c
@@ -635,7 +635,10 @@
         seq[nb] = '\0';
         if (print_princ) {
             // TODO: better multibyte handling
-            outs(seq, f);
+            if (wc == 0)
+                ios_putc(0, f);
+            else
+                outs(seq, f);
         }
         else {
             outsn("#\\", f, 2);
--- a/tests/unittest.lsp
+++ b/tests/unittest.lsp
@@ -78,6 +78,7 @@
 (assert (equal? (uint64 (double -123)) #uint64(0xffffffffffffff85)))
 
 (assert (equal? (string 'sym #byte(65) #wchar(945) "blah") "symA\u03B1blah"))
+(assert (= (length (string #\x0)) 1))
 
 (assert (> 9223372036854775808 9223372036854775807))