diff src/os_unix.c @ 2707:cd3f52531f6c v7.3.124

updated for version 7.3.124 Problem: When writing a file in binary mode it may be missing the final EOL if a file previously read was missing the EOL. (Kevin Goodsell) Solution: Move the write_no_eol_lnum into the buffer struct.
author Bram Moolenaar <bram@vim.org>
date Tue, 15 Feb 2011 17:39:22 +0100
parents 6d80dbca8501
children c5e47b752f07
line wrap: on
line diff
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4245,7 +4245,7 @@ mch_call_shell(cmd, options)
 				 * should not have one. */
 				if (lnum != curbuf->b_op_end.lnum
 					|| !curbuf->b_p_bin
-					|| (lnum != write_no_eol_lnum
+					|| (lnum != curbuf->b_no_eol_lnum
 					    && (lnum !=
 						    curbuf->b_ml.ml_line_count
 						    || curbuf->b_p_eol)))
@@ -4588,10 +4588,10 @@ finished:
 		    {
 			append_ga_line(&ga);
 			/* remember that the NL was missing */
-			write_no_eol_lnum = curwin->w_cursor.lnum;
+			curbuf->b_no_eol_lnum = curwin->w_cursor.lnum;
 		    }
 		    else
-			write_no_eol_lnum = 0;
+			curbuf->b_no_eol_lnum = 0;
 		    ga_clear(&ga);
 		}