home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.2 / 7.2.407 < prev    next >
Encoding:
Internet Message Format  |  2010-03-22  |  1.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.2.407
  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.2.407
  11. Problem:    When using an expression in ":s" backslashes in the result are
  12.         dropped. (Sergey Goldgaber, Christian Brabandt)
  13. Solution:   Double backslashes.
  14. Files:        src/regexp.c
  15.  
  16.  
  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
  19. ***************
  20. *** 6963,6968 ****
  21. --- 6963,6970 ----
  22.           eval_result = eval_to_string(source + 2, NULL, TRUE);
  23.           if (eval_result != NULL)
  24.           {
  25. +         int had_backslash = FALSE;
  26.           for (s = eval_result; *s != NUL; mb_ptr_adv(s))
  27.           {
  28.               /* Change NL to CR, so that it becomes a line break.
  29. ***************
  30. *** 6970,6976 ****
  31. --- 6972,6991 ----
  32.               if (*s == NL)
  33.               *s = CAR;
  34.               else if (*s == '\\' && s[1] != NUL)
  35. +             {
  36.               ++s;
  37. +             had_backslash = TRUE;
  38. +             }
  39. +         }
  40. +         if (had_backslash && backslash)
  41. +         {
  42. +             /* Backslashes will be consumed, need to double them. */
  43. +             s = vim_strsave_escaped(eval_result, (char_u *)"\\");
  44. +             if (s != NULL)
  45. +             {
  46. +             vim_free(eval_result);
  47. +             eval_result = s;
  48. +             }
  49.           }
  50.   
  51.           dst += STRLEN(eval_result);
  52. *** ../vim-7.2.406/src/version.c    2010-03-23 15:36:29.000000000 +0100
  53. --- src/version.c    2010-03-23 16:26:22.000000000 +0100
  54. ***************
  55. *** 683,684 ****
  56. --- 683,686 ----
  57.   {   /* Add new patch number below this line */
  58. + /**/
  59. +     407,
  60.   /**/
  61.  
  62. -- 
  63. Sorry, no fortune today.
  64.  
  65.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  66. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  67. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  68.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  69.