4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When using an expression in ":s" backslashes in the result are
12 dropped. (Sergey Goldgaber, Christian Brabandt)
13 Solution: Double backslashes.
17 *** ../vim-7.2.406/src/regexp.c 2009-11-26 20:41:19.000000000 +0100
18 --- src/regexp.c 2010-03-23 16:22:35.000000000 +0100
22 eval_result = eval_to_string(source + 2, NULL, TRUE);
23 if (eval_result != NULL)
25 + int had_backslash = FALSE;
27 for (s = eval_result; *s != NUL; mb_ptr_adv(s))
29 /* Change NL to CR, so that it becomes a line break.
35 else if (*s == '\\' && s[1] != NUL)
38 + had_backslash = TRUE;
41 + if (had_backslash && backslash)
43 + /* Backslashes will be consumed, need to double them. */
44 + s = vim_strsave_escaped(eval_result, (char_u *)"\\");
47 + vim_free(eval_result);
52 dst += STRLEN(eval_result);
53 *** ../vim-7.2.406/src/version.c 2010-03-23 15:36:29.000000000 +0100
54 --- src/version.c 2010-03-23 16:26:22.000000000 +0100
58 { /* Add new patch number below this line */
64 Sorry, no fortune today.
66 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
67 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
68 \\\ download, build and distribute -- http://www.A-A-P.org ///
69 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///