Change string-copy to return legacy string only if arg is also legacy.
authorChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 2017 07:20:30 +0000 (00:20 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 2017 07:20:30 +0000 (00:20 -0700)
src/runtime/ustring.scm

index 4acf9bff8b9bcab7f4c559a5130c157c09e8231d..3607bfd17a549534f4de3efcb034a3f39cb249e8 100644 (file)
@@ -370,8 +370,7 @@ USA.
       (lambda (string start end)
        (let* ((n (fix:- end start))
               (to
-               (if (or (fix:= 1 (ustring-cp-size string))
-                       (fix:< (%general-max-cp string start end) #x100))
+               (if (legacy-string? string)
                    (legacy-string-allocate n)
                    (mutable-ustring-allocate n))))
          (%general-copy! to 0 string start end)