patch 7.4.785
Problem: On some systems automatically adding the missing EOL causes
problems. Setting 'binary' has too many side effects.
Solution: Add the 'fixeol' option, default on. (Pavel Samarkin)
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index eba28f8..da47989 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -45,6 +45,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
@@ -195,6 +196,7 @@
test_erasebackword.out: test_erasebackword.in
test_eval.out: test_eval.in
test_increment.out: test_increment.in
+test_fixeol.out: test_fixeol.in
test_insertcount.out: test_insertcount.in
test_listchars.out: test_listchars.in
test_listlbr.out: test_listlbr.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index eecb735..6bb0577 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -44,6 +44,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 29d931d..faa2294 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -66,6 +66,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index f473d89..b93408c 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -46,6 +46,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 437f9b1..1c6a56d 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2015 Jul 10
+# Last change: 2015 Jul 17
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -105,6 +105,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 656a744..1a3ff85 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -42,6 +42,7 @@
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_fixeol.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
diff --git a/src/testdir/test_fixeol.in b/src/testdir/test_fixeol.in
new file mode 100644
index 0000000..a881fb1
--- /dev/null
+++ b/src/testdir/test_fixeol.in
@@ -0,0 +1,40 @@
+Tests for 'fixeol' vim: set ft=vim :
+
+STARTTEST
+:" first write two test files – with and without trailing EOL
+:" use Unix fileformat for consistency
+:set ff=unix
+:enew!
+awith eol:w! XXEol
+:enew!
+:set noeol nofixeol
+awithout eol:w! XXNoEol
+:set eol fixeol
+:bwipe XXEol XXNoEol
+:"
+:" try editing files with 'fixeol' disabled
+:e! XXEol
+ostays eol:set nofixeol
+:w! XXTestEol
+:e! XXNoEol
+ostays without:set nofixeol
+:w! XXTestNoEol
+:bwipe XXEol XXNoEol XXTestEol XXTestNoEol
+:set fixeol
+:"
+:" Append "END" to each file so that we can see what the last written char was.
+ggdGaEND:w >>XXEol
+:w >>XXNoEol
+:w >>XXTestEol
+:w >>XXTestNoEol
+:"
+:" Concatenate the results
+:e! test.out
+a0:$r XXEol
+:$r XXNoEol
+Go1:$r XXTestEol
+:$r XXTestNoEol
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test_fixeol.ok b/src/testdir/test_fixeol.ok
new file mode 100644
index 0000000..68ac9be
--- /dev/null
+++ b/src/testdir/test_fixeol.ok
@@ -0,0 +1,10 @@
+0
+with eol
+END
+without eolEND
+1
+with eol
+stays eol
+END
+without eol
+stays withoutEND