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.0.047 < prev    next >
Encoding:
Internet Message Format  |  2001-10-30  |  2.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.047
  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.0.047
  11. Problem:    Using a regexp with "\(\)" inside a "\%[]" item causes a crash.
  12.         (Samuel Lacas)
  13. Solution:   Don't allow nested atoms inside "\%[]".
  14. Files:        src/regexp.c
  15.  
  16.  
  17. *** ../vim60.46/src/regexp.c    Wed Oct 24 19:41:55 2001
  18. --- src/regexp.c    Wed Oct 31 14:49:48 2001
  19. ***************
  20. *** 316,321 ****
  21. --- 316,322 ----
  22.   #define EMSG_RET_NULL(m) { EMSG(_(m)); rc_did_emsg = TRUE; return NULL; }
  23.   #define EMSG_M_RET_NULL(m, c) { EMSG2(_(m), c ? "" : "\\"); rc_did_emsg = TRUE; return NULL; }
  24.   #define EMSG_RET_FAIL(m) { EMSG(_(m)); rc_did_emsg = TRUE; return FAIL; }
  25. + #define EMSG_ONE_RET_NULL EMSG_M_RET_NULL("E369: invalid item in %s%%[]", reg_magic == MAGIC_ALL)
  26.   
  27.   #define MAX_LIMIT    (32767L << 16L)
  28.   
  29. ***************
  30. *** 1444,1449 ****
  31. --- 1445,1452 ----
  32.       break;
  33.   
  34.         case Magic('('):
  35. +     if (one_exactly)
  36. +         EMSG_ONE_RET_NULL;
  37.       ret = reg(REG_PAREN, &flags);
  38.       if (ret == NULL)
  39.           return NULL;
  40. ***************
  41. *** 1526,1531 ****
  42. --- 1529,1536 ----
  43.           {
  44.           case '(': if (reg_do_extmatch != REX_SET)
  45.                     EMSG_RET_NULL("E66: \\z( not allowed here");
  46. +               if (one_exactly)
  47. +                   EMSG_ONE_RET_NULL;
  48.                 ret = reg(REG_ZPAREN, &flags);
  49.                 if (ret == NULL)
  50.                     return NULL;
  51. ***************
  52. *** 1565,1570 ****
  53. --- 1570,1577 ----
  54.           {
  55.           /* () without a back reference */
  56.           case '(':
  57. +             if (one_exactly)
  58. +             EMSG_ONE_RET_NULL;
  59.               ret = reg(REG_NPAREN, &flags);
  60.               if (ret == NULL)
  61.               return NULL;
  62. ***************
  63. *** 1588,1593 ****
  64. --- 1595,1602 ----
  65.           /* \%[abc]: Emit as a list of branches, all ending at the last
  66.            * branch which matches nothing. */
  67.           case '[':
  68. +               if (one_exactly)    /* doesn't nest */
  69. +                   EMSG_ONE_RET_NULL;
  70.                 {
  71.                     char_u    *lastbranch;
  72.                     char_u    *lastnode = NULL;
  73. *** ../vim60.46/src/version.c    Wed Oct 31 14:21:02 2001
  74. --- src/version.c    Wed Oct 31 14:52:47 2001
  75. ***************
  76. *** 608,609 ****
  77. --- 608,611 ----
  78.   {   /* Add new patch number below this line */
  79. + /**/
  80. +     47,
  81.   /**/
  82.  
  83. -- 
  84. It is illegal to take more than three sips of beer at a time while standing.
  85.         [real standing law in Texas, United States of America]
  86.  
  87.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  88. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  89.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  90.