Annotation of pkgsrc/lang/python21/patches/patch-bf, revision 1.1

1.1     ! adrianp     1: $NetBSD$
        !             2: 
        !             3: --- Modules/pypcre.c.orig      2000-08-02 14:41:18.000000000 +0100
        !             4: +++ Modules/pypcre.c
        !             5: @@ -1162,14 +1162,31 @@ read_repeat_counts(const uschar *p, int 
        !             6:  int min = 0;
        !             7:  int max = -1;
        !             8:  
        !             9: +/* Read the minimum value and do a paranoid check: a negative value indicates
        !            10: +an integer overflow. */
        !            11: +
        !            12:  while ((pcre_ctypes[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0';
        !            13:  
        !            14: +if (min < 0 || min > 65535)
        !            15: +  {
        !            16: +  *errorptr = ERR5;
        !            17: +  return p;
        !            18: +  }
        !            19: +
        !            20: +/* Read the maximum value if there is one, and again do a paranoid on its size
        !            21: +. Also, max must not be less than min. */
        !            22: +
        !            23:  if (*p == '}') max = min; else
        !            24:    {
        !            25:    if (*(++p) != '}')
        !            26:      {
        !            27:      max = 0;
        !            28:      while((pcre_ctypes[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0';
        !            29: +    if (max < 0 || max > 65535)
        !            30: +      {
        !            31: +      *errorptr = ERR5;
        !            32: +      return p;
        !            33: +      }
        !            34:      if (max < min)
        !            35:        {
        !            36:        *errorptr = ERR4;
        !            37: @@ -2266,6 +2283,7 @@ int c, size;
        !            38:  int bracount = 0;
        !            39:  int brastack[200];
        !            40:  int top_backref = 0;
        !            41: +BOOL capturing;
        !            42:  unsigned int brastackptr = 0;
        !            43:  uschar *code;
        !            44:  const uschar *ptr;
        !            45: @@ -2445,7 +2463,8 @@ while ((c = *(++ptr)) != 0)
        !            46:      /* Brackets may be genuine groups or special things */
        !            47:  
        !            48:      case '(':
        !            49: -
        !            50: +    capturing = FALSE;
        !            51: +    
        !            52:      /* Handle special forms of bracket, which all start (? */
        !            53:  
        !            54:      if (ptr[1] == '?') switch (c = ptr[2])
        !            55: @@ -2541,11 +2560,16 @@ while ((c = *(++ptr)) != 0)
        !            56:          }
        !            57:        continue;                      /* End of this bracket handling */
        !            58:        }
        !            59: +    
        !            60: +    /* Ordinary parentheses, not followed by '?', are capturing unless
        !            61: +    PCRE_NO_AUTO_CAPTURE is set. */
        !            62:  
        !            63: +    else capturing = (options & PCRE_NO_AUTO_CAPTURE) == 0;
        !            64: +    
        !            65:      /* Extracting brackets must be counted so we can process escapes in a
        !            66:      Perlish way. */
        !            67: -
        !            68: -    else bracount++;
        !            69: +    
        !            70: +    if (capturing) bracount++;
        !            71:  
        !            72:      /* Non-special forms of bracket. Save length for computing whole length
        !            73:      at end if there's a repeat that requires duplication of the group. */

CVSweb <webmaster@jp.NetBSD.org>