]>
Commit | Line | Data |
---|---|---|
d8621708 | 1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.2.051 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.2.051 | |
11 | Problem: When using "\=submatch(0)" in a ":s" command, line breaks become | |
12 | NUL characters. | |
13 | Solution: Change NL to CR characters, so that they become line breaks. | |
14 | Files: src/regexp.c | |
15 | ||
16 | ||
17 | *** ../vim-6.2.050/src/regexp.c Sun May 18 16:42:59 2003 | |
18 | --- src/regexp.c Fri Jun 27 20:21:44 2003 | |
19 | *************** | |
20 | *** 5705,5711 **** | |
21 | --- 5705,5727 ---- | |
22 | ||
23 | eval_result = eval_to_string(source + 2, NULL); | |
24 | if (eval_result != NULL) | |
25 | + { | |
26 | + for (s = eval_result; *s != NUL; ++s) | |
27 | + { | |
28 | + /* Change NL to CR, so that it becomes a line break. | |
29 | + * Skip over a backslashed character. */ | |
30 | + if (*s == NL) | |
31 | + *s = CR; | |
32 | + else if (*s == '\\' && s[1] != NUL) | |
33 | + ++s; | |
34 | + #ifdef FEAT_MBYTE | |
35 | + if (has_mbyte) | |
36 | + s += (*mb_ptr2len_check)(s) - 1; | |
37 | + #endif | |
38 | + } | |
39 | + | |
40 | dst += STRLEN(eval_result); | |
41 | + } | |
42 | ||
43 | reg_match = submatch_match; | |
44 | reg_mmatch = submatch_mmatch; | |
45 | *************** | |
46 | *** 5713,5719 **** | |
47 | reg_win = save_reg_win; | |
48 | ireg_ic = save_ireg_ic; | |
49 | can_f_submatch = FALSE; | |
50 | - | |
51 | } | |
52 | #endif | |
53 | } | |
54 | --- 5729,5734 ---- | |
55 | *** ../vim-6.2.050/src/version.c Sun Jul 27 14:44:09 2003 | |
56 | --- src/version.c Sun Jul 27 14:46:53 2003 | |
57 | *************** | |
58 | *** 632,633 **** | |
59 | --- 632,635 ---- | |
60 | { /* Add new patch number below this line */ | |
61 | + /**/ | |
62 | + 51, | |
63 | /**/ | |
64 | ||
65 | -- | |
66 | BEDEVERE: Why do you think she is a witch? | |
67 | SECOND VILLAGER: She turned me into a newt. | |
68 | BEDEVERE: A newt? | |
69 | SECOND VILLAGER: (After looking at himself for some time) I got better. | |
70 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
71 | ||
72 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
73 | /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ | |
74 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
75 | \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// |