4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Internal lalloc(0) error when using a complicated multi-line
12 pattern in a substitute command. (Luc Hermitte)
13 Solution: Avoid going past the end of a line.
17 *** ../vim-6.3.011/src/ex_cmds.c Thu Jun 10 21:08:20 2004
18 --- src/ex_cmds.c Tue Jul 6 14:47:37 2004
22 unsigned len, needed_len;
23 long nmatch_tl = 0; /* nr of lines matched below lnum */
24 int do_again; /* do it again after joining lines */
25 + int skip_match = FALSE;
28 * The new text is build up step by step, to avoid too much
31 && regmatch.endpos[0].lnum == 0
32 && matchcol == regmatch.endpos[0].col)
34 ! ++matchcol; /* search for a match at next column */
39 && regmatch.endpos[0].lnum == 0
40 && matchcol == regmatch.endpos[0].col)
42 ! if (sub_firstline[matchcol] == NUL)
43 ! /* We already were at the end of the line. Don't look
44 ! * for a match in this line again. */
47 ! ++matchcol; /* search for a match at next column */
53 /* We already know that we did the last subst when we are at
54 * the end of the line, except that a pattern like
55 * "bar\|\nfoo" may match at the NUL. */
56 ! lastone = ((sub_firstline[matchcol] == NUL && nmatch <= 1
57 ! && !re_multiline(regmatch.regprog))
58 ! || got_int || got_quit || !(do_all || do_again));
63 /* We already know that we did the last subst when we are at
64 * the end of the line, except that a pattern like
65 * "bar\|\nfoo" may match at the NUL. */
66 ! lastone = (skip_match
69 ! || !(do_all || do_again)
70 ! || (sub_firstline[matchcol] == NUL && nmatch <= 1
71 ! && !re_multiline(regmatch.regprog)));
75 *** ../vim-6.3.011/src/version.c Fri Jul 2 22:00:36 2004
76 --- src/version.c Tue Jul 6 14:56:13 2004
80 { /* Add new patch number below this line */
86 Kisses may last for as much as, but no more than, five minutes.
87 [real standing law in Iowa, United States of America]
89 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
90 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
91 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
92 \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///