]> git.wh0rd.org Git - nano.git/commitdiff
write_file() - Increment lineswritten when the very last line isn't null. Fixes...
authorChris Allegretta <chrisa@asty.org>
Sat, 30 Jun 2001 18:41:08 +0000 (18:41 +0000)
committerChris Allegretta <chrisa@asty.org>
Sat, 30 Jun 2001 18:41:08 +0000 (18:41 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@704 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

BUGS
ChangeLog
files.c

diff --git a/BUGS b/BUGS
index 2533e62ab3eb3b234083ed1f506c5688c6fbc260..9db3c8592e0f08fc02cd0604b0fd148c2bc3f6fa 100644 (file)
--- a/BUGS
+++ b/BUGS
 
 ** Open BUGS **
 
-Informal note - when using marked write to file, the number of lines
-written is off by one.  Delete this message when fixed.
-
 $Id$
index 9f8ab3c1f0bb6b901d3894ba8dfb2b816a1bc36e..124bceeb18f03362fb03e069caee6798d43602b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,8 @@ Cvs code -
   write_file()
        - New arg, nonamechange, means whether or not to update the
          current filename after writing the file out.
+       - Increment lineswritten when the very last line isn't null.
+         Fixes off by one count when writing selection to file.
 - global.c:
        - Updated some of the lists for the "Goto Directory" code (Rocco)
 - move.c:
diff --git a/files.c b/files.c
index f37d7a795901d277e9069ba22ccce8e1d7ff0173..62dd5f722719fe098fb3949a609db77a0e26f6a9 100644 (file)
--- a/files.c
+++ b/files.c
@@ -448,6 +448,7 @@ int write_file(char *name, int tmp, int append, int nonamechange)
            return -1;
        } else if (size > 0) {
            size = write(fd, "\n", 1);
+           lineswritten++;
            if (size == -1) {
                statusbar(_("Could not open file for writing: %s"),
                          strerror(errno));