4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
10 Patch 6.2.287 (after 6.2.264)
11 Problem: Duplicate lines are added to the viminfo file.
12 Solution: Compare with existing entries without an offset. Also fixes
13 reading very long history lines from viminfo.
17 *** ../vim-6.2.286/src/ex_getln.c Tue Feb 17 20:22:36 2004
18 --- src/ex_getln.c Tue Feb 24 14:38:36 2004
28 type = hist_char2type(virp->vir_line[0]);
29 if (viminfo_hisidx[type] < viminfo_hislen[type])
31 ! /* Use a zero offset, so that we have some extra space in the
32 ! * allocated memory for the separator. */
33 ! val = viminfo_readstring(virp, 0, TRUE);
36 ! if (!in_history(type, val, viminfo_add_at_front))
39 ! if (type == HIST_SEARCH)
41 ! /* Search entry: Move the separator from the second column
42 ! * to after the NUL. */
45 ! mch_memmove(val, val + 2, (size_t)len);
46 ! val[len] = (sep == ' ' ? NUL : sep);
50 ! /* Not a search entry: No separator in the viminfo file,
51 ! * add a NUL separator. */
52 ! mch_memmove(val, val + 1, (size_t)len);
55 - viminfo_history[type][viminfo_hisidx[type]++] = val;
61 return viminfo_readline(virp);
71 type = hist_char2type(virp->vir_line[0]);
72 if (viminfo_hisidx[type] < viminfo_hislen[type])
74 ! val = viminfo_readstring(virp, 1, TRUE);
75 ! if (val != NULL && *val != NUL)
77 ! if (!in_history(type, val + (type == HIST_SEARCH),
78 ! viminfo_add_at_front))
80 + /* Need to re-allocate to append the separator byte. */
82 ! p = lalloc(len + 2, TRUE);
85 ! if (type == HIST_SEARCH)
87 ! /* Search entry: Move the separator from the first
88 ! * column to after the NUL. */
89 ! mch_memmove(p, val + 1, (size_t)len);
90 ! p[len] = (*val == ' ' ? NUL : *val);
94 ! /* Not a search entry: No separator in the viminfo
95 ! * file, add a NUL separator. */
96 ! mch_memmove(p, val, (size_t)len + 1);
99 ! viminfo_history[type][viminfo_hisidx[type]++] = p;
105 return viminfo_readline(virp);
107 *** ../vim-6.2.286/src/version.c Tue Feb 24 15:19:00 2004
108 --- src/version.c Tue Feb 24 15:21:20 2004
112 { /* Add new patch number below this line */
118 hundred-and-one symptoms of being an internet addict:
119 239. You think "surfing" is something you do on dry land.
121 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
122 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
123 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
124 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///