Skip to content

Commit bc5c9c0

Browse files
committed
updated for version 7.4.643
Problem: Using the default file format for Mac files. (Issue 77) Solution: Reset the try_mac counter in the right place. (Oswald)
1 parent 13edc1b commit bc5c9c0

File tree

4 files changed

+52
-26
lines changed

4 files changed

+52
-26
lines changed

src/fileio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,12 +2099,12 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
20992099
/* First try finding a NL, for Dos and Unix */
21002100
if (try_dos || try_unix)
21012101
{
2102+
/* Reset the carriage return counter. */
2103+
if (try_mac)
2104+
try_mac = 1;
2105+
21022106
for (p = ptr; p < ptr + size; ++p)
21032107
{
2104-
/* Reset the carriage return counter. */
2105-
if (try_mac)
2106-
try_mac = 1;
2107-
21082108
if (*p == NL)
21092109
{
21102110
if (!try_unix

src/testdir/test30.in

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,33 @@ STARTTEST
77
:" first write three test files, one in each format
88
:set fileformat=unix
99
:set fileformats=
10-
:/^1/w! XX1
11-
:/^2/w! XX2
12-
:/^3/w! XX3
13-
:/^4/w! XX4
14-
:/^5/w! XX5
15-
:/^6/w! XX6
16-
:/^7/w! XX7
17-
:/^8/w! XX8
18-
:/^9/w! XX9
19-
:/^10/w! XX10
2010
:/^unix/;/eof/-1w! XXUnix
2111
:/^dos/;/eof/-1w! XXDos
2212
:set bin noeol
2313
:$w! XXMac
14+
Gonoeol
15+
:$w! XXEol
2416
:set nobin eol
17+
:enew!
2518
:bwipe XXUnix XXDos XXMac
2619
:" create mixed format files
2720
:if has("vms")
2821
: !copy XXUnix,XXDos XXUxDs.
2922
: !copy XXUnix,XXMac XXUxMac.
3023
: !copy XXDos,XXMac XXDosMac.
24+
: !copy XXMac,XXEol XXMacEol.
3125
: !copy XXUnix,XXDos,XXMac XXUxDsMc.
3226
:elseif has("win32")
3327
: !copy /b XXUnix+XXDos XXUxDs
3428
: !copy /b XXUnix+XXMac XXUxMac
3529
: !copy /b XXDos+XXMac XXDosMac
30+
: !copy /b XXMac+XXEol XXMacEol
3631
: !copy /b XXUnix+XXDos+XXMac XXUxDsMc
3732
:else
3833
: !cat XXUnix XXDos >XXUxDs
3934
: !cat XXUnix XXMac >XXUxMac
4035
: !cat XXDos XXMac >XXDosMac
36+
: !cat XXMac XXEol >XXMacEol
4137
: !cat XXUnix XXDos XXMac >XXUxDsMc
4238
:endif
4339
:"
@@ -102,26 +98,48 @@ STARTTEST
10298
:e! XXDosMac
10399
:w! XXtt53
104100
:bwipe XXDosMac
101+
:e! XXEol
102+
ggO=&ffs
103+
:=&ff
104+
:w! XXtt54
105+
:bwipe XXEol
105106
:set fileformats=dos,mac
106107
:e! XXUxDs
107108
:w! XXtt61
108109
:bwipe XXUxDs
109110
:e! XXUxMac
110-
:w! XXtt62
111+
ggO=&ffs
112+
:=&ff
113+
:w! XXtt62
111114
:bwipe XXUxMac
112115
:e! XXUxDsMc
113116
:w! XXtt63
114117
:bwipe XXUxDsMc
118+
:e! XXMacEol
119+
ggO=&ffs
120+
:=&ff
121+
:w! XXtt64
122+
:bwipe XXMacEol
115123
:"
116124
:" try reading and writing with 'fileformats' set to three formats
117125
:set fileformats=unix,dos,mac
118126
:e! XXUxDsMc
119127
:w! XXtt71
120128
:bwipe XXUxDsMc
129+
:e! XXEol
130+
ggO=&ffs
131+
:=&ff
132+
:w! XXtt72
133+
:bwipe XXEol
121134
:set fileformats=mac,dos,unix
122135
:e! XXUxDsMc
123136
:w! XXtt81
124137
:bwipe XXUxDsMc
138+
:e! XXEol
139+
ggO=&ffs
140+
:=&ff
141+
:w! XXtt82
142+
:bwipe XXEol
125143
:" try with 'binary' set
126144
:set fileformats=mac,unix,dos
127145
:set binary
@@ -155,11 +173,15 @@ ggdGaEND:w >>XXtt01
155173
:w >>XXtt51
156174
:w >>XXtt52
157175
:w >>XXtt53
176+
:w >>XXtt54
158177
:w >>XXtt61
159178
:w >>XXtt62
160179
:w >>XXtt63
180+
:w >>XXtt64
161181
:w >>XXtt71
182+
:w >>XXtt72
162183
:w >>XXtt81
184+
:w >>XXtt82
163185
:w >>XXtt91
164186
:w >>XXtt92
165187
:w >>XXtt93
@@ -186,11 +208,15 @@ Go4:$r XXtt41
186208
Go5:$r XXtt51
187209
:$r XXtt52
188210
:$r XXtt53
211+
:$r XXtt54
189212
Go6:$r XXtt61
190213
:$r XXtt62
191214
:$r XXtt63
215+
:$r XXtt64
192216
Go7:$r XXtt71
217+
:$r XXtt72
193218
Go8:$r XXtt81
219+
:$r XXtt82
194220
Go9:$r XXtt91
195221
:$r XXtt92
196222
:$r XXtt93
@@ -200,17 +226,6 @@ Go10:$r XXUnix
200226
:qa!
201227
ENDTEST
202228

203-
1
204-
2
205-
3
206-
4
207-
5
208-
6
209-
7
210-
8
211-
9
212-
10
213-
214229
unix
215230
unix
216231
eof

src/testdir/test30.ok

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ END
7070
dos
7171
dos
7272
macmacEND
73+
unix,mac:unix
74+
noeol
75+
END
7376
6
7477
unix
7578
unix
7679
dos
7780
dos
7881
END
82+
dos,mac:dos
7983
unix
8084
unix
8185
macmac
@@ -86,20 +90,25 @@ dos
8690
dos
8791
macmac
8892
END
93+
dos,mac:macmacmacnoeolEND
8994
7
9095
unix
9196
unix
9297
dos
9398
dos
9499
macmac
95100
END
101+
unix,dos,mac:unix
102+
noeol
103+
END
96104
8
97105
unix
98106
unix
99107
dos
100108
dos
101109
macmac
102110
END
111+
mac,dos,unix:macnoeolEND
103112
9
104113
unix
105114
unix

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
643,
744746
/**/
745747
642,
746748
/**/

0 commit comments

Comments
 (0)