Fix bug: GROUP-INSERT-FILE! was depending on the fact that
authorChris Hanson <org/chris-hanson/cph>
Wed, 15 May 1996 19:10:52 +0000 (19:10 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 15 May 1996 19:10:52 +0000 (19:10 +0000)
INPUT-BUFFER/READ-SUBSTRING did not return until the argument buffer
was full -- which is no longer true.

v7/src/edwin/fileio.scm

index 9f0cb49147f2bff295d89fac539f6a3513f1ed90..1feaa669c4820ed23b5c763f3b44443ba98411fd 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: fileio.scm,v 1.137 1996/05/11 08:37:57 cph Exp $
+;;;    $Id: fileio.scm,v 1.138 1996/05/15 19:10:52 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology
 ;;;
@@ -199,7 +199,16 @@ of the predicates is satisfied, the file is written in the usual way."
               (let ((text (group-text group))
                     (end (fix:+ index length)))
                 (if buffer
-                    (input-buffer/read-substring buffer text index end)
+                    (fix:- (let loop ((index index))
+                             (if (fix:< index end)
+                                 (let ((n
+                                        (input-buffer/read-substring
+                                         buffer text index end)))
+                                   (if (fix:= n 0)
+                                       index
+                                       (loop (fix:+ index n))))
+                                 index))
+                           index)
                     (channel-read-block channel text index end)))))
          (if (fix:> n 0)
              (without-interrupts