(Fwrite_region): Move the code that writes annotations for empty files.
authorRichard M. Stallman <rms@gnu.org>
Fri, 10 Nov 1995 06:44:54 +0000 (06:44 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 10 Nov 1995 06:44:54 +0000 (06:44 +0000)
src/fileio.c

index f6f99e5..47b987a 100644 (file)
@@ -3427,13 +3427,12 @@ to the file, instead of any buffer contents, and END is ignored.")
          nwritten += XINT (end) - tem;
          save_errno = errno;
        }
-
-      if (nwritten == 0)
-       {
-         /* If file was empty, still need to write the annotations */
-         failure = 0 > a_write (desc, "", 0, XINT (start), &annotations);
-         save_errno = errno;
-       }
+    }
+  else
+    {
+      /* If file was empty, still need to write the annotations */
+      failure = 0 > a_write (desc, "", 0, XINT (start), &annotations);
+      save_errno = errno;
     }
 
   immediate_quit = 0;