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 / 6.2.051 < prev    next >
Encoding:
Internet Message Format  |  2003-10-13  |  2.1 KB

  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.           dst += STRLEN(eval_result);
  40. +         }
  41.   
  42.           reg_match = submatch_match;
  43.           reg_mmatch = submatch_mmatch;
  44. ***************
  45. *** 5713,5719 ****
  46.           reg_win = save_reg_win;
  47.           ireg_ic = save_ireg_ic;
  48.           can_f_submatch = FALSE;
  49.       }
  50.   #endif
  51.       }
  52. --- 5729,5734 ----
  53. *** ../vim-6.2.050/src/version.c    Sun Jul 27 14:44:09 2003
  54. --- src/version.c    Sun Jul 27 14:46:53 2003
  55. ***************
  56. *** 632,633 ****
  57. --- 632,635 ----
  58.   {   /* Add new patch number below this line */
  59. + /**/
  60. +     51,
  61.   /**/
  62.  
  63. -- 
  64. BEDEVERE:        Why do you think she is a witch?
  65. SECOND VILLAGER: She turned me into a newt.
  66. BEDEVERE:        A newt?
  67. SECOND VILLAGER: (After looking at himself for some time) I got better.
  68.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  69.  
  70.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  71. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  72. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  73.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  74.