[Python-checkins] python/dist/src/Modules _sre.c,2.91,2.92

niemeyer@users.sourceforge.net niemeyer@users.sourceforge.net
Tue, 22 Apr 2003 08:39:24 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv26197/Modules

Modified Files:
	_sre.c 
Log Message:
Made MAX_UNTIL/MIN_UNTIL code more coherent about mark protection,
accordingly to further discussions with Greg Chapman in patch #712900.


Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.91
retrieving revision 2.92
diff -C2 -d -r2.91 -r2.92
*** _sre.c	20 Apr 2003 07:35:44 -0000	2.91
--- _sre.c	22 Apr 2003 15:39:09 -0000	2.92
***************
*** 1162,1165 ****
--- 1162,1166 ----
              state->repeat = rp;
              state->ptr = ptr;
+             LASTMARK_RESTORE();
              return 0;
  
***************
*** 1172,1175 ****
--- 1173,1178 ----
                  return SRE_ERROR_STATE;
  
+             state->ptr = ptr;
+ 
              count = rp->count + 1;
  
***************
*** 1177,1181 ****
                     rp->pattern));
  
!             state->ptr = ptr;
  
              if (count < rp->pattern[1]) {
--- 1180,1184 ----
                     rp->pattern));
  
!             LASTMARK_SAVE();
  
              if (count < rp->pattern[1]) {
***************
*** 1188,1196 ****
                  rp->count = count-1;
                  state->ptr = ptr;
                  return 0;
              }
  
-             LASTMARK_SAVE();
- 
              /* see if the tail matches */
              state->repeat = rp->prev;
--- 1191,1198 ----
                  rp->count = count-1;
                  state->ptr = ptr;
+                 LASTMARK_RESTORE();
                  return 0;
              }
  
              /* see if the tail matches */
              state->repeat = rp->prev;
***************
*** 1203,1207 ****
  
              LASTMARK_RESTORE();
- 
              if (count >= rp->pattern[2] && rp->pattern[2] != 65535)
                  return 0;
--- 1205,1208 ----
***************
*** 1214,1217 ****
--- 1215,1219 ----
              rp->count = count - 1;
              state->ptr = ptr;
+             LASTMARK_RESTORE();
              return 0;