Karsten Hopp b040ab
To: vim_dev@googlegroups.com
Karsten Hopp b040ab
Subject: Patch 7.4.643
Karsten Hopp b040ab
Fcc: outbox
Karsten Hopp b040ab
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp b040ab
Mime-Version: 1.0
Karsten Hopp b040ab
Content-Type: text/plain; charset=UTF-8
Karsten Hopp b040ab
Content-Transfer-Encoding: 8bit
Karsten Hopp b040ab
------------
Karsten Hopp b040ab
Karsten Hopp b040ab
Patch 7.4.643
Karsten Hopp b040ab
Problem:    Using the default file format for Mac files. (Issue 77)
Karsten Hopp b040ab
Solution:   Reset the try_mac counter in the right place. (Oswald)
Karsten Hopp b040ab
Files:	    src/fileio.c, src/testdir/test30.in, src/testdir/test30.ok
Karsten Hopp b040ab
Karsten Hopp b040ab
Karsten Hopp b040ab
*** ../vim-7.4.642/src/fileio.c	2015-02-17 16:04:50.816104407 +0100
Karsten Hopp b040ab
--- src/fileio.c	2015-02-27 17:44:07.687994962 +0100
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 2099,2110 ****
Karsten Hopp b040ab
  		/* First try finding a NL, for Dos and Unix */
Karsten Hopp b040ab
  		if (try_dos || try_unix)
Karsten Hopp b040ab
  		{
Karsten Hopp b040ab
  		    for (p = ptr; p < ptr + size; ++p)
Karsten Hopp b040ab
  		    {
Karsten Hopp b040ab
- 			/* Reset the carriage return counter. */
Karsten Hopp b040ab
- 			if (try_mac)
Karsten Hopp b040ab
- 			    try_mac = 1;
Karsten Hopp b040ab
- 
Karsten Hopp b040ab
  			if (*p == NL)
Karsten Hopp b040ab
  			{
Karsten Hopp b040ab
  			    if (!try_unix
Karsten Hopp b040ab
--- 2099,2110 ----
Karsten Hopp b040ab
  		/* First try finding a NL, for Dos and Unix */
Karsten Hopp b040ab
  		if (try_dos || try_unix)
Karsten Hopp b040ab
  		{
Karsten Hopp b040ab
+ 		    /* Reset the carriage return counter. */
Karsten Hopp b040ab
+ 		    if (try_mac)
Karsten Hopp b040ab
+ 			try_mac = 1;
Karsten Hopp b040ab
+ 
Karsten Hopp b040ab
  		    for (p = ptr; p < ptr + size; ++p)
Karsten Hopp b040ab
  		    {
Karsten Hopp b040ab
  			if (*p == NL)
Karsten Hopp b040ab
  			{
Karsten Hopp b040ab
  			    if (!try_unix
Karsten Hopp b040ab
*** ../vim-7.4.642/src/testdir/test30.in	2010-08-04 16:07:46.000000000 +0200
Karsten Hopp b040ab
--- src/testdir/test30.in	2015-02-27 17:42:21.697191823 +0100
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 7,43 ****
Karsten Hopp b040ab
  :" first write three test files, one in each format
Karsten Hopp b040ab
  :set fileformat=unix
Karsten Hopp b040ab
  :set fileformats=
Karsten Hopp b040ab
- :/^1/w! XX1
Karsten Hopp b040ab
- :/^2/w! XX2
Karsten Hopp b040ab
- :/^3/w! XX3
Karsten Hopp b040ab
- :/^4/w! XX4
Karsten Hopp b040ab
- :/^5/w! XX5
Karsten Hopp b040ab
- :/^6/w! XX6
Karsten Hopp b040ab
- :/^7/w! XX7
Karsten Hopp b040ab
- :/^8/w! XX8
Karsten Hopp b040ab
- :/^9/w! XX9
Karsten Hopp b040ab
- :/^10/w! XX10
Karsten Hopp b040ab
  :/^unix/;/eof/-1w! XXUnix
Karsten Hopp b040ab
  :/^dos/;/eof/-1w! XXDos
Karsten Hopp b040ab
  :set bin noeol
Karsten Hopp b040ab
  :$w! XXMac
Karsten Hopp b040ab
  :set nobin eol
Karsten Hopp b040ab
  :bwipe XXUnix XXDos XXMac
Karsten Hopp b040ab
  :" create mixed format files
Karsten Hopp b040ab
  :if has("vms")
Karsten Hopp b040ab
  : !copy XXUnix,XXDos XXUxDs.
Karsten Hopp b040ab
  : !copy XXUnix,XXMac XXUxMac.
Karsten Hopp b040ab
  : !copy XXDos,XXMac  XXDosMac.
Karsten Hopp b040ab
  : !copy XXUnix,XXDos,XXMac XXUxDsMc.
Karsten Hopp b040ab
  :elseif has("win32")
Karsten Hopp b040ab
  : !copy /b XXUnix+XXDos XXUxDs
Karsten Hopp b040ab
  : !copy /b XXUnix+XXMac XXUxMac
Karsten Hopp b040ab
  : !copy /b XXDos+XXMac XXDosMac
Karsten Hopp b040ab
  : !copy /b XXUnix+XXDos+XXMac XXUxDsMc
Karsten Hopp b040ab
  :else
Karsten Hopp b040ab
  : !cat XXUnix XXDos >XXUxDs
Karsten Hopp b040ab
  : !cat XXUnix XXMac >XXUxMac
Karsten Hopp b040ab
  : !cat XXDos XXMac >XXDosMac
Karsten Hopp b040ab
  : !cat XXUnix XXDos XXMac >XXUxDsMc
Karsten Hopp b040ab
  :endif
Karsten Hopp b040ab
  :"
Karsten Hopp b040ab
--- 7,39 ----
Karsten Hopp b040ab
  :" first write three test files, one in each format
Karsten Hopp b040ab
  :set fileformat=unix
Karsten Hopp b040ab
  :set fileformats=
Karsten Hopp b040ab
  :/^unix/;/eof/-1w! XXUnix
Karsten Hopp b040ab
  :/^dos/;/eof/-1w! XXDos
Karsten Hopp b040ab
  :set bin noeol
Karsten Hopp b040ab
  :$w! XXMac
Karsten Hopp b040ab
+ Gonoeol?
Karsten Hopp b040ab
+ :$w! XXEol
Karsten Hopp b040ab
  :set nobin eol
Karsten Hopp b040ab
+ :enew!
Karsten Hopp b040ab
  :bwipe XXUnix XXDos XXMac
Karsten Hopp b040ab
  :" create mixed format files
Karsten Hopp b040ab
  :if has("vms")
Karsten Hopp b040ab
  : !copy XXUnix,XXDos XXUxDs.
Karsten Hopp b040ab
  : !copy XXUnix,XXMac XXUxMac.
Karsten Hopp b040ab
  : !copy XXDos,XXMac  XXDosMac.
Karsten Hopp b040ab
+ : !copy XXMac,XXEol  XXMacEol.
Karsten Hopp b040ab
  : !copy XXUnix,XXDos,XXMac XXUxDsMc.
Karsten Hopp b040ab
  :elseif has("win32")
Karsten Hopp b040ab
  : !copy /b XXUnix+XXDos XXUxDs
Karsten Hopp b040ab
  : !copy /b XXUnix+XXMac XXUxMac
Karsten Hopp b040ab
  : !copy /b XXDos+XXMac XXDosMac
Karsten Hopp b040ab
+ : !copy /b XXMac+XXEol XXMacEol
Karsten Hopp b040ab
  : !copy /b XXUnix+XXDos+XXMac XXUxDsMc
Karsten Hopp b040ab
  :else
Karsten Hopp b040ab
  : !cat XXUnix XXDos >XXUxDs
Karsten Hopp b040ab
  : !cat XXUnix XXMac >XXUxMac
Karsten Hopp b040ab
  : !cat XXDos XXMac >XXDosMac
Karsten Hopp b040ab
+ : !cat XXMac XXEol >XXMacEol
Karsten Hopp b040ab
  : !cat XXUnix XXDos XXMac >XXUxDsMc
Karsten Hopp b040ab
  :endif
Karsten Hopp b040ab
  :"
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 102,127 ****
Karsten Hopp b040ab
  :e! XXDosMac
Karsten Hopp b040ab
  :w! XXtt53
Karsten Hopp b040ab
  :bwipe XXDosMac
Karsten Hopp b040ab
  :set fileformats=dos,mac
Karsten Hopp b040ab
  :e! XXUxDs
Karsten Hopp b040ab
  :w! XXtt61
Karsten Hopp b040ab
  :bwipe XXUxDs
Karsten Hopp b040ab
  :e! XXUxMac
Karsten Hopp b040ab
! :w! XXtt62
Karsten Hopp b040ab
  :bwipe XXUxMac
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt63
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
  :"
Karsten Hopp b040ab
  :" try reading and writing with 'fileformats' set to three formats
Karsten Hopp b040ab
  :set fileformats=unix,dos,mac
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt71
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
  :set fileformats=mac,dos,unix
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt81
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
  :" try with 'binary' set
Karsten Hopp b040ab
  :set fileformats=mac,unix,dos
Karsten Hopp b040ab
  :set binary
Karsten Hopp b040ab
--- 98,145 ----
Karsten Hopp b040ab
  :e! XXDosMac
Karsten Hopp b040ab
  :w! XXtt53
Karsten Hopp b040ab
  :bwipe XXDosMac
Karsten Hopp b040ab
+ :e! XXEol
Karsten Hopp b040ab
+ ggO?=&ffs
Karsten Hopp b040ab
+ :?=&ff
Karsten Hopp b040ab
+ ?:w! XXtt54
Karsten Hopp b040ab
+ :bwipe XXEol
Karsten Hopp b040ab
  :set fileformats=dos,mac
Karsten Hopp b040ab
  :e! XXUxDs
Karsten Hopp b040ab
  :w! XXtt61
Karsten Hopp b040ab
  :bwipe XXUxDs
Karsten Hopp b040ab
  :e! XXUxMac
Karsten Hopp b040ab
! ggO?=&ffs
Karsten Hopp b040ab
! :?=&ff
Karsten Hopp b040ab
! ?:w! XXtt62
Karsten Hopp b040ab
  :bwipe XXUxMac
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt63
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
+ :e! XXMacEol
Karsten Hopp b040ab
+ ggO?=&ffs
Karsten Hopp b040ab
+ :?=&ff
Karsten Hopp b040ab
+ ?:w! XXtt64
Karsten Hopp b040ab
+ :bwipe XXMacEol
Karsten Hopp b040ab
  :"
Karsten Hopp b040ab
  :" try reading and writing with 'fileformats' set to three formats
Karsten Hopp b040ab
  :set fileformats=unix,dos,mac
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt71
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
+ :e! XXEol
Karsten Hopp b040ab
+ ggO?=&ffs
Karsten Hopp b040ab
+ :?=&ff
Karsten Hopp b040ab
+ ?:w! XXtt72
Karsten Hopp b040ab
+ :bwipe XXEol
Karsten Hopp b040ab
  :set fileformats=mac,dos,unix
Karsten Hopp b040ab
  :e! XXUxDsMc
Karsten Hopp b040ab
  :w! XXtt81
Karsten Hopp b040ab
  :bwipe XXUxDsMc
Karsten Hopp b040ab
+ :e! XXEol
Karsten Hopp b040ab
+ ggO?=&ffs
Karsten Hopp b040ab
+ :?=&ff
Karsten Hopp b040ab
+ ?:w! XXtt82
Karsten Hopp b040ab
+ :bwipe XXEol
Karsten Hopp b040ab
  :" try with 'binary' set
Karsten Hopp b040ab
  :set fileformats=mac,unix,dos
Karsten Hopp b040ab
  :set binary
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 155,165 ****
Karsten Hopp b040ab
--- 173,187 ----
Karsten Hopp b040ab
  :w >>XXtt51
Karsten Hopp b040ab
  :w >>XXtt52
Karsten Hopp b040ab
  :w >>XXtt53
Karsten Hopp b040ab
+ :w >>XXtt54
Karsten Hopp b040ab
  :w >>XXtt61
Karsten Hopp b040ab
  :w >>XXtt62
Karsten Hopp b040ab
  :w >>XXtt63
Karsten Hopp b040ab
+ :w >>XXtt64
Karsten Hopp b040ab
  :w >>XXtt71
Karsten Hopp b040ab
+ :w >>XXtt72
Karsten Hopp b040ab
  :w >>XXtt81
Karsten Hopp b040ab
+ :w >>XXtt82
Karsten Hopp b040ab
  :w >>XXtt91
Karsten Hopp b040ab
  :w >>XXtt92
Karsten Hopp b040ab
  :w >>XXtt93
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 186,196 ****
Karsten Hopp b040ab
--- 208,222 ----
Karsten Hopp b040ab
  Go5?:$r XXtt51
Karsten Hopp b040ab
  :$r XXtt52
Karsten Hopp b040ab
  :$r XXtt53
Karsten Hopp b040ab
+ :$r XXtt54
Karsten Hopp b040ab
  Go6?:$r XXtt61
Karsten Hopp b040ab
  :$r XXtt62
Karsten Hopp b040ab
  :$r XXtt63
Karsten Hopp b040ab
+ :$r XXtt64
Karsten Hopp b040ab
  Go7?:$r XXtt71
Karsten Hopp b040ab
+ :$r XXtt72
Karsten Hopp b040ab
  Go8?:$r XXtt81
Karsten Hopp b040ab
+ :$r XXtt82
Karsten Hopp b040ab
  Go9?:$r XXtt91
Karsten Hopp b040ab
  :$r XXtt92
Karsten Hopp b040ab
  :$r XXtt93
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 200,216 ****
Karsten Hopp b040ab
  :qa!
Karsten Hopp b040ab
  ENDTEST
Karsten Hopp b040ab
  
Karsten Hopp b040ab
- 1
Karsten Hopp b040ab
- 2
Karsten Hopp b040ab
- 3
Karsten Hopp b040ab
- 4
Karsten Hopp b040ab
- 5
Karsten Hopp b040ab
- 6
Karsten Hopp b040ab
- 7
Karsten Hopp b040ab
- 8
Karsten Hopp b040ab
- 9
Karsten Hopp b040ab
- 10
Karsten Hopp b040ab
- 
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  eof
Karsten Hopp b040ab
--- 226,231 ----
Karsten Hopp b040ab
*** ../vim-7.4.642/src/testdir/test30.ok	2010-05-15 13:04:10.000000000 +0200
Karsten Hopp b040ab
--- src/testdir/test30.ok	2015-02-27 17:28:04.602871329 +0100
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 70,81 ****
Karsten Hopp b040ab
--- 70,85 ----
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  mac
mac
END
Karsten Hopp b040ab
+ unix,mac:unix
Karsten Hopp b040ab
+ noeol
Karsten Hopp b040ab
+ END
Karsten Hopp b040ab
  6
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  END
Karsten Hopp b040ab
+ dos,mac:dos
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  mac
mac

Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 86,91 ****
Karsten Hopp b040ab
--- 90,96 ----
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  mac
mac

Karsten Hopp b040ab
  END
Karsten Hopp b040ab
+ dos,mac:mac
mac
mac
noeol
END
Karsten Hopp b040ab
  7
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 93,98 ****
Karsten Hopp b040ab
--- 98,106 ----
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  mac
mac
Karsten Hopp b040ab
  END
Karsten Hopp b040ab
+ unix,dos,mac:unix
Karsten Hopp b040ab
+ noeol
Karsten Hopp b040ab
+ END
Karsten Hopp b040ab
  8
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 100,105 ****
Karsten Hopp b040ab
--- 108,114 ----
Karsten Hopp b040ab
  dos
Karsten Hopp b040ab
  mac
mac
Karsten Hopp b040ab
  END
Karsten Hopp b040ab
+ mac,dos,unix:mac
noeol
END
Karsten Hopp b040ab
  9
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
  unix
Karsten Hopp b040ab
*** ../vim-7.4.642/src/version.c	2015-02-27 17:19:07.104942344 +0100
Karsten Hopp b040ab
--- src/version.c	2015-02-27 17:45:08.927303273 +0100
Karsten Hopp b040ab
***************
Karsten Hopp b040ab
*** 743,744 ****
Karsten Hopp b040ab
--- 743,746 ----
Karsten Hopp b040ab
  {   /* Add new patch number below this line */
Karsten Hopp b040ab
+ /**/
Karsten Hopp b040ab
+     643,
Karsten Hopp b040ab
  /**/
Karsten Hopp b040ab
Karsten Hopp b040ab
-- 
Karsten Hopp b040ab
Microsoft: "Windows NT 4.0 now has the same user-interface as Windows 95"
Karsten Hopp b040ab
    Windows 95: "Press CTRL-ALT-DEL to reboot"
Karsten Hopp b040ab
Windows NT 4.0: "Press CTRL-ALT-DEL to login"
Karsten Hopp b040ab
Karsten Hopp b040ab
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp b040ab
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp b040ab
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp b040ab
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///