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.3 / 7.3.1010 < prev    next >
Encoding:
Internet Message Format  |  2013-05-23  |  4.7 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1010
  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.3.1010
  11. Problem:    New regexp: adding \Z makes every character match.
  12. Solution:   Only apply ireg_icombine for composing characters.
  13.         Alsl add missing change from patch 1008. (Ken Takata)
  14. Files:        src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok
  15.  
  16.  
  17. *** ../vim-7.3.1009/src/regexp_nfa.c    2013-05-23 22:25:10.000000000 +0200
  18. --- src/regexp_nfa.c    2013-05-24 20:20:14.000000000 +0200
  19. ***************
  20. *** 2859,2865 ****
  21.       List    *listtbl[2][2];
  22.       List    *ll;
  23.       int        listid = 1;
  24. !     int        endnode = 0;
  25.       List    *thislist;
  26.       List    *nextlist;
  27.       List    *neglist;
  28. --- 2859,2865 ----
  29.       List    *listtbl[2][2];
  30.       List    *ll;
  31.       int        listid = 1;
  32. !     int        endnode;
  33.       List    *thislist;
  34.       List    *nextlist;
  35.       List    *neglist;
  36. ***************
  37. *** 3192,3204 ****
  38.   
  39.           case NFA_MULTIBYTE:
  40.           case NFA_COMPOSING:
  41. !         switch (t->state->c)
  42. !         {
  43. !             case NFA_MULTIBYTE:        endnode = NFA_END_MULTIBYTE; break;
  44. !             case NFA_COMPOSING:        endnode = NFA_END_COMPOSING; break;
  45. !             default:            endnode = 0;
  46. !         }
  47.           result = OK;
  48.           sta = t->state->out;
  49.           len = 1;
  50. --- 3192,3198 ----
  51.   
  52.           case NFA_MULTIBYTE:
  53.           case NFA_COMPOSING:
  54. !             endnode = t->state->c + 1;
  55.           result = OK;
  56.           sta = t->state->out;
  57.           len = 1;
  58. ***************
  59. *** 3206,3212 ****
  60.           {
  61.               if (reginput[len-1] != sta->c)
  62.               {
  63. !             result = OK - 1;
  64.               break;
  65.               }
  66.               len++;
  67. --- 3200,3206 ----
  68.           {
  69.               if (reginput[len-1] != sta->c)
  70.               {
  71. !             result = FAIL;
  72.               break;
  73.               }
  74.               len++;
  75. ***************
  76. *** 3215,3225 ****
  77.   
  78.           /* if input char length doesn't match regexp char length */
  79.           if (len -1 < n || sta->c != endnode)
  80. !             result = OK - 1;
  81.           end = t->state->out1;        /* NFA_END_MULTIBYTE or
  82.                              NFA_END_COMPOSING */
  83.           /* If \Z was present, then ignore composing characters */
  84. !         if (regflags & RF_ICOMBINE)
  85.               result = 1 ^ sta->negated;
  86.           ADD_POS_NEG_STATE(end);
  87.           break;
  88. --- 3209,3219 ----
  89.   
  90.           /* if input char length doesn't match regexp char length */
  91.           if (len -1 < n || sta->c != endnode)
  92. !             result = FAIL;
  93.           end = t->state->out1;        /* NFA_END_MULTIBYTE or
  94.                              NFA_END_COMPOSING */
  95.           /* If \Z was present, then ignore composing characters */
  96. !         if (ireg_icombine && endnode == NFA_END_COMPOSING)
  97.               result = 1 ^ sta->negated;
  98.           ADD_POS_NEG_STATE(end);
  99.           break;
  100. *** ../vim-7.3.1009/src/testdir/test95.in    2013-05-23 22:43:03.000000000 +0200
  101. --- src/testdir/test95.in    2013-05-24 20:18:13.000000000 +0200
  102. ***************
  103. *** 7,13 ****
  104.   STARTTEST
  105.   :so small.vim
  106.   :so mbyte.vim
  107. ! :set nocp encoding=utf-8 viminfo+=nviminfo
  108.   :" tl is a List of Lists with:
  109.   :"    regexp pattern
  110.   :"    text to test the pattern on
  111. --- 7,13 ----
  112.   STARTTEST
  113.   :so small.vim
  114.   :so mbyte.vim
  115. ! :set nocp encoding=utf-8 viminfo+=nviminfo nomore
  116.   :" tl is a List of Lists with:
  117.   :"    regexp pattern
  118.   :"    text to test the pattern on
  119. ***************
  120. *** 35,45 ****
  121.   :call add(tl, ['\f\+', '&*┬ƒfname ', 'fname'])
  122.   :call add(tl, ['\%#=1\f\+', '&*┬ƒfname ', 'fname'])
  123.   
  124.   :"""" Combining different tests and features
  125.   :call add(tl, ['[^[=a=]]\+', 'dda├ú├óbcd', 'dd'])
  126.   
  127.   :"""" Run the tests
  128.   :"
  129.   :for t in tl
  130.   :  let l = matchlist(t[1], t[0])
  131. --- 35,47 ----
  132.   :call add(tl, ['\f\+', '&*┬ƒfname ', 'fname'])
  133.   :call add(tl, ['\%#=1\f\+', '&*┬ƒfname ', 'fname'])
  134.   
  135. + :"""" Test \Z
  136. + :call add(tl, ['├║\Z', 'x'])
  137.   :"""" Combining different tests and features
  138.   :call add(tl, ['[^[=a=]]\+', 'dda├ú├óbcd', 'dd'])
  139.   
  140.   :"""" Run the tests
  141.   :"
  142.   :for t in tl
  143.   :  let l = matchlist(t[1], t[0])
  144. *** ../vim-7.3.1009/src/testdir/test95.ok    2013-05-23 22:43:03.000000000 +0200
  145. --- src/testdir/test95.ok    2013-05-24 20:18:55.000000000 +0200
  146. ***************
  147. *** 9,12 ****
  148. --- 9,13 ----
  149.   OK - \%#=1\i\+
  150.   OK - \f\+
  151.   OK - \%#=1\f\+
  152. + OK - ├║\Z
  153.   OK - [^[=a=]]\+
  154. *** ../vim-7.3.1009/src/version.c    2013-05-24 18:58:39.000000000 +0200
  155. --- src/version.c    2013-05-24 20:21:52.000000000 +0200
  156. ***************
  157. *** 730,731 ****
  158. --- 730,733 ----
  159.   {   /* Add new patch number below this line */
  160. + /**/
  161. +     1010,
  162.   /**/
  163.  
  164. -- 
  165. Never under any circumstances take a sleeping pill
  166. and a laxative on the same night.
  167.  
  168.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  169. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  170. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  171.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  172.