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.0 / 7.0.144 < prev    next >
Encoding:
Internet Message Format  |  2006-10-16  |  5.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.0.144
  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 7.0.144
  11. Problem:    May compare two unrelated pointers when matching a pattern against
  12.         a string.  (Dominique Pelle)
  13. Solution:   Avoid calling reg_getline() when REG_MULTI is false.
  14. Files:        src/regexp.c
  15.  
  16.  
  17. *** ../vim-7.0.143/src/regexp.c    Tue Aug 29 17:28:56 2006
  18. --- src/regexp.c    Tue Oct 17 18:30:18 2006
  19. ***************
  20. *** 3777,3784 ****
  21.   
  22.       op = OP(scan);
  23.       /* Check for character class with NL added. */
  24. !     if (!reg_line_lbr && WITH_NL(op) && *reginput == NUL
  25. !                             && reglnum <= reg_maxline)
  26.       {
  27.           reg_nextline();
  28.       }
  29. --- 3777,3784 ----
  30.   
  31.       op = OP(scan);
  32.       /* Check for character class with NL added. */
  33. !     if (!reg_line_lbr && WITH_NL(op) && REG_MULTI
  34. !                 && *reginput == NUL && reglnum <= reg_maxline)
  35.       {
  36.           reg_nextline();
  37.       }
  38. ***************
  39. *** 4855,4862 ****
  40.           break;
  41.   
  42.         case NEWL:
  43. !         if ((c != NUL || reglnum > reg_maxline || reg_line_lbr)
  44. !                           && (c != '\n' || !reg_line_lbr))
  45.           status = RA_NOMATCH;
  46.           else if (reg_line_lbr)
  47.           ADVANCE_REGINPUT();
  48. --- 4855,4862 ----
  49.           break;
  50.   
  51.         case NEWL:
  52. !         if ((c != NUL || !REG_MULTI || reglnum > reg_maxline
  53. !                  || reg_line_lbr) && (c != '\n' || !reg_line_lbr))
  54.           status = RA_NOMATCH;
  55.           else if (reg_line_lbr)
  56.           ADVANCE_REGINPUT();
  57. ***************
  58. *** 5316,5323 ****
  59.           ++count;
  60.           mb_ptr_adv(scan);
  61.           }
  62. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr
  63. !                              || count == maxcount)
  64.           break;
  65.           ++count;        /* count the line-break */
  66.           reg_nextline();
  67. --- 5316,5323 ----
  68.           ++count;
  69.           mb_ptr_adv(scan);
  70.           }
  71. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  72. !                      || reg_line_lbr || count == maxcount)
  73.           break;
  74.           ++count;        /* count the line-break */
  75.           reg_nextline();
  76. ***************
  77. *** 5341,5347 ****
  78.           }
  79.           else if (*scan == NUL)
  80.           {
  81. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  82.               break;
  83.           reg_nextline();
  84.           scan = reginput;
  85. --- 5341,5348 ----
  86.           }
  87.           else if (*scan == NUL)
  88.           {
  89. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  90. !                                   || reg_line_lbr)
  91.               break;
  92.           reg_nextline();
  93.           scan = reginput;
  94. ***************
  95. *** 5370,5376 ****
  96.           }
  97.           else if (*scan == NUL)
  98.           {
  99. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  100.               break;
  101.           reg_nextline();
  102.           scan = reginput;
  103. --- 5371,5378 ----
  104.           }
  105.           else if (*scan == NUL)
  106.           {
  107. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  108. !                                   || reg_line_lbr)
  109.               break;
  110.           reg_nextline();
  111.           scan = reginput;
  112. ***************
  113. *** 5399,5405 ****
  114.           }
  115.           else if (*scan == NUL)
  116.           {
  117. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  118.               break;
  119.           reg_nextline();
  120.           scan = reginput;
  121. --- 5401,5408 ----
  122.           }
  123.           else if (*scan == NUL)
  124.           {
  125. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  126. !                                   || reg_line_lbr)
  127.               break;
  128.           reg_nextline();
  129.           scan = reginput;
  130. ***************
  131. *** 5424,5430 ****
  132.       {
  133.           if (*scan == NUL)
  134.           {
  135. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  136.               break;
  137.           reg_nextline();
  138.           scan = reginput;
  139. --- 5427,5434 ----
  140.       {
  141.           if (*scan == NUL)
  142.           {
  143. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  144. !                                   || reg_line_lbr)
  145.               break;
  146.           reg_nextline();
  147.           scan = reginput;
  148. ***************
  149. *** 5454,5460 ****
  150.   #endif
  151.           if (*scan == NUL)
  152.           {
  153. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  154.               break;
  155.           reg_nextline();
  156.           scan = reginput;
  157. --- 5458,5465 ----
  158.   #endif
  159.           if (*scan == NUL)
  160.           {
  161. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  162. !                                   || reg_line_lbr)
  163.               break;
  164.           reg_nextline();
  165.           scan = reginput;
  166. ***************
  167. *** 5617,5623 ****
  168.   #endif
  169.           if (*scan == NUL)
  170.           {
  171. !         if (!WITH_NL(OP(p)) || reglnum > reg_maxline || reg_line_lbr)
  172.               break;
  173.           reg_nextline();
  174.           scan = reginput;
  175. --- 5622,5629 ----
  176.   #endif
  177.           if (*scan == NUL)
  178.           {
  179. !         if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > reg_maxline
  180. !                                   || reg_line_lbr)
  181.               break;
  182.           reg_nextline();
  183.           scan = reginput;
  184. ***************
  185. *** 5646,5653 ****
  186.   
  187.         case NEWL:
  188.       while (count < maxcount
  189. !         && ((*scan == NUL && reglnum <= reg_maxline && !reg_line_lbr)
  190. !             || (*scan == '\n' && reg_line_lbr)))
  191.       {
  192.           count++;
  193.           if (reg_line_lbr)
  194. --- 5652,5659 ----
  195.   
  196.         case NEWL:
  197.       while (count < maxcount
  198. !         && ((*scan == NUL && reglnum <= reg_maxline && !reg_line_lbr
  199. !                 && REG_MULTI) || (*scan == '\n' && reg_line_lbr)))
  200.       {
  201.           count++;
  202.           if (reg_line_lbr)
  203. *** ../vim-7.0.143/src/version.c    Tue Oct 17 18:36:03 2006
  204. --- src/version.c    Tue Oct 17 18:48:51 2006
  205. ***************
  206. *** 668,669 ****
  207. --- 668,671 ----
  208.   {   /* Add new patch number below this line */
  209. + /**/
  210. +     144,
  211.   /**/
  212.  
  213. -- 
  214. Be thankful to be in a traffic jam, because it means you own a car.
  215.  
  216.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  217. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  218. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  219.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  220.