If a file insertion doesn't insert any data, don't do any of the
authorChris Hanson <org/chris-hanson/cph>
Tue, 2 May 1995 20:49:06 +0000 (20:49 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 2 May 1995 20:49:06 +0000 (20:49 +0000)
post-processing that sets the modification bit, etc.

v7/src/edwin/fileio.scm

index cd72018561a7baf58b508545a775002c5310e57b..694d977ccfe188adfd42b53182cc4b228c2c52d2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: fileio.scm,v 1.126 1995/04/30 07:12:12 cph Exp $
+;;;    $Id: fileio.scm,v 1.127 1995/05/02 20:49:06 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
 ;;;
@@ -155,11 +155,12 @@ Each procedure is called with three arguments:
                 (if buffer
                     (input-buffer/read-substring buffer text index end)
                     (channel-read-block channel text index end)))))
-         (without-interrupts
-           (lambda ()
-             (let ((gap-start* (fix:+ index n)))
-               (undo-record-insertion! group index gap-start*)
-               (finish-group-insert! group index n))))
+         (if (fix:> n 0)
+             (without-interrupts
+               (lambda ()
+                 (let ((gap-start* (fix:+ index n)))
+                   (undo-record-insertion! group index gap-start*)
+                   (finish-group-insert! group index n)))))
          (channel-close channel)
          n)))))
 \f