diff --git a/scheme/xml/reader.scm b/scheme/xml/reader.scm index b516450..7b4c2ad 100644 --- a/scheme/xml/reader.scm +++ b/scheme/xml/reader.scm @@ -330,7 +330,8 @@ ;; positionify : Input-port -> Input-port (-> Location) -;; Well, this really depends on scsh-0.6 +;; Well, this really depends on scsh-0.6 and should be replace by +;; big-scheme's more-port ;; For S48 you probably need to do something completely different (define (positionify in) @@ -338,6 +339,7 @@ (char 0) (offset 0) (old-handler (port-handler in))) + (set-port-buffering in bufpol/block 1) (let ((handler (make-buffered-input-port-handler (port-handler-discloser old-handler) (port-handler-close old-handler) @@ -349,11 +351,10 @@ (begin (set! char (add1 char)) (set! offset (add1 offset)) - (let ((c (peek-char in))) - (when (equal? c #\newline) + (let ((c (byte-vector-ref buffer 0))) + (when (= c 10) (set! line (+ line 1)) - (set! char 0)) - c))) + (set! char -1))))) res)) (port-handler-ready? old-handler) (port-handler-steal old-handler)))) diff --git a/scheme/xml/structures.scm b/scheme/xml/structures.scm index 5e986d9..c590132 100644 --- a/scheme/xml/structures.scm +++ b/scheme/xml/structures.scm @@ -63,7 +63,7 @@ (dtd prolog-dtd) (misc2 prolog-misc2)) -(define (make-prolog misc dtd misc2) +(define (make-prolog misc dtd . misc2) (really-make-prolog misc dtd misc2)) ;;; Document-type = (make-document-type sym External-dtd #f) diff --git a/scheme/xml/xml-packages.scm b/scheme/xml/xml-packages.scm index 4df4261..68ac8a8 100644 --- a/scheme/xml/xml-packages.scm +++ b/scheme/xml/xml-packages.scm @@ -67,6 +67,7 @@ i/o-internal ports plt-compat + byte-vectors signals) (files reader))