emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/regex.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/regex.c
Date: Sun, 05 Dec 2004 19:48:21 -0500

Index: emacs/src/regex.c
diff -c emacs/src/regex.c:1.197 emacs/src/regex.c:1.198
*** emacs/src/regex.c:1.197     Sun Dec  5 23:34:16 2004
--- emacs/src/regex.c   Mon Dec  6 00:41:40 2004
***************
*** 1950,1977 ****
  
  /* Get the next unsigned number in the uncompiled pattern.  */
  #define GET_UNSIGNED_NUMBER(num)                                      \
!  do { if (p != pend)                                                  \
!      {                                                                        
\
!        PATFETCH (c);                                                  \
!        if (c == ' ')                                                  \
!        FREE_STACK_RETURN (REG_BADBR);                                 \
!        while ('0' <= c && c <= '9')                                   \
!        {                                                              \
!            int prev;                                                  \
!          if (num < 0)                                                 \
!            num = 0;                                                   \
!          prev = num;                                                  \
!          num = num * 10 + c - '0';                                    \
!          if (num / 10 != prev)                                        \
!            FREE_STACK_RETURN (REG_BADBR);                             \
!          if (p == pend)                                               \
!            break;                                                     \
!          PATFETCH (c);                                                \
!        }                                                              \
!        if (c == ' ')                                                  \
!        FREE_STACK_RETURN (REG_BADBR);                                 \
!        }                                                              \
!     } while (0)
  
  #if ! WIDE_CHAR_SUPPORT
  
--- 1950,1976 ----
  
  /* Get the next unsigned number in the uncompiled pattern.  */
  #define GET_UNSIGNED_NUMBER(num)                                      \
!   do {                                                                        
\
!     if (p == pend)                                                    \
!       FREE_STACK_RETURN (REG_EBRACE);                                 \
!     else                                                              \
!       {                                                                       
\
!       PATFETCH (c);                                                   \
!       while ('0' <= c && c <= '9')                                    \
!         {                                                             \
!           int prev;                                                   \
!           if (num < 0)                                                \
!             num = 0;                                                  \
!           prev = num;                                                 \
!           num = num * 10 + c - '0';                                   \
!           if (num / 10 != prev)                                       \
!             FREE_STACK_RETURN (REG_BADBR);                            \
!           if (p == pend)                                              \
!             FREE_STACK_RETURN (REG_EBRACE);                           \
!           PATFETCH (c);                                               \
!         }                                                             \
!       }                                                                       
\
!   } while (0)
  
  #if ! WIDE_CHAR_SUPPORT
  
***************
*** 3234,3242 ****
  
                beg_interval = p;
  
-               if (p == pend)
-                 FREE_STACK_RETURN (REG_EBRACE);
- 
                GET_UNSIGNED_NUMBER (lower_bound);
  
                if (c == ',')
--- 3233,3238 ----
***************
*** 3253,3259 ****
                  {
                    if (c != '\\')
                      FREE_STACK_RETURN (REG_BADBR);
! 
                    PATFETCH (c);
                  }
  
--- 3249,3256 ----
                  {
                    if (c != '\\')
                      FREE_STACK_RETURN (REG_BADBR);
!                   if (p == pend)
!                     FREE_STACK_RETURN (REG_EESCAPE);
                    PATFETCH (c);
                  }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]