OPEN-WIDE-INPUT-STRING was checking to see if its argument was a
authorChris Hanson <org/chris-hanson/cph>
Thu, 3 Jul 2003 04:33:50 +0000 (04:33 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 3 Jul 2003 04:33:50 +0000 (04:33 +0000)
string rather than a wide string.

v7/src/runtime/unicode.scm

index 121d3da88c29ea5eaa5411ce6cd350ba4a8c4203..c340a817a968a82ba0787f317c586730ef0cabfb 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: unicode.scm,v 1.10 2003/06/14 05:00:33 cph Exp $
+$Id: unicode.scm,v 1.11 2003/07/03 04:33:50 cph Exp $
 
 Copyright 2001,2003 Massachusetts Institute of Technology
 
@@ -639,7 +639,17 @@ USA.
                 (loop)))))))))
 \f
 (define (open-wide-input-string string #!optional start end)
-  (with-substring-args string start end 'OPEN-WIDE-INPUT-STRING
+  (guarantee-wide-string string 'OPEN-WIDE-INPUT-STRING)
+  (let* ((end
+         (if (or (default-object? end) (not end))
+             (wide-string-length string)
+             (guarantee-substring-end-index end (wide-string-length string)
+                                            'OPEN-WIDE-INPUT-STRING)))
+        (start
+         (if (or (default-object? start) (not start))
+             0
+             (guarantee-substring-start-index start end
+                                              'OPEN-WIDE-INPUT-STRING))))
     (make-port ws-input-port-type (make-ws-input-state string start end))))
 
 (define ws-input-port-type)