]>
Commit | Line | Data |
---|---|---|
c6060300 MT |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.150 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.150 | |
11 | Problem: readline() does not return the last line when the NL is missing. | |
12 | (Hong Xu) | |
13 | Solution: When at the end of the file Also check for a previous line. | |
14 | Files: src/eval.c | |
15 | ||
16 | ||
17 | *** ../vim-7.3.149/src/eval.c 2011-03-27 16:03:09.000000000 +0200 | |
18 | --- src/eval.c 2011-04-01 16:06:04.000000000 +0200 | |
19 | *************** | |
20 | *** 14305,14313 **** | |
21 | { | |
22 | if (buf[filtd] == '\n' || readlen <= 0) | |
23 | { | |
24 | ! /* Only when in binary mode add an empty list item when the | |
25 | ! * last line ends in a '\n'. */ | |
26 | ! if (!binary && readlen == 0 && filtd == 0) | |
27 | break; | |
28 | ||
29 | /* Found end-of-line or end-of-file: add a text line to the | |
30 | --- 14305,14313 ---- | |
31 | { | |
32 | if (buf[filtd] == '\n' || readlen <= 0) | |
33 | { | |
34 | ! /* In binary mode add an empty list item when the last | |
35 | ! * non-empty line ends in a '\n'. */ | |
36 | ! if (!binary && readlen == 0 && filtd == 0 && prev == NULL) | |
37 | break; | |
38 | ||
39 | /* Found end-of-line or end-of-file: add a text line to the | |
40 | *************** | |
41 | *** 14372,14396 **** | |
42 | ||
43 | if (tolist == 0) | |
44 | { | |
45 | ! /* "buf" is full, need to move text to an allocated buffer */ | |
46 | ! if (prev == NULL) | |
47 | { | |
48 | ! prev = vim_strnsave(buf, buflen); | |
49 | ! prevlen = buflen; | |
50 | ! } | |
51 | ! else | |
52 | ! { | |
53 | ! s = alloc((unsigned)(prevlen + buflen)); | |
54 | ! if (s != NULL) | |
55 | { | |
56 | ! mch_memmove(s, prev, prevlen); | |
57 | ! mch_memmove(s + prevlen, buf, buflen); | |
58 | ! vim_free(prev); | |
59 | ! prev = s; | |
60 | ! prevlen += buflen; | |
61 | } | |
62 | } | |
63 | - filtd = 0; | |
64 | } | |
65 | else | |
66 | { | |
67 | --- 14372,14399 ---- | |
68 | ||
69 | if (tolist == 0) | |
70 | { | |
71 | ! if (buflen >= FREAD_SIZE / 2) | |
72 | { | |
73 | ! /* "buf" is full, need to move text to an allocated buffer */ | |
74 | ! if (prev == NULL) | |
75 | ! { | |
76 | ! prev = vim_strnsave(buf, buflen); | |
77 | ! prevlen = buflen; | |
78 | ! } | |
79 | ! else | |
80 | { | |
81 | ! s = alloc((unsigned)(prevlen + buflen)); | |
82 | ! if (s != NULL) | |
83 | ! { | |
84 | ! mch_memmove(s, prev, prevlen); | |
85 | ! mch_memmove(s + prevlen, buf, buflen); | |
86 | ! vim_free(prev); | |
87 | ! prev = s; | |
88 | ! prevlen += buflen; | |
89 | ! } | |
90 | } | |
91 | + filtd = 0; | |
92 | } | |
93 | } | |
94 | else | |
95 | { | |
96 | *** ../vim-7.3.149/src/version.c 2011-04-01 15:33:54.000000000 +0200 | |
97 | --- src/version.c 2011-04-01 16:04:42.000000000 +0200 | |
98 | *************** | |
99 | *** 716,717 **** | |
100 | --- 716,719 ---- | |
101 | { /* Add new patch number below this line */ | |
102 | + /**/ | |
103 | + 150, | |
104 | /**/ | |
105 | ||
106 | -- | |
107 | ARTHUR: What are you going to do. bleed on me? | |
108 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
109 | ||
110 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
111 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
112 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
113 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |