pike.git / src / modules / Regexp / pike_regexp.c

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:243:    * code and thus invalidate pointers into it. (Note that it has to be in    * one piece because free() must be able to free it all.)    *    * Beware that the optimization-preparation code in here knows about some    * of the structure of the compiled regexp.    */   regexp *pike_regcomp(char *exp,int excompat)   {    register regexp *r = NULL;    register char *scan; -  register char *longest; -  register ptrdiff_t len; +     int flags;    short *exp2,*dest,c;       if (exp == NULL)    FAIL("NULL argument");       exp2=xcalloc( (strlen(exp)+1), sizeof(short) );    for ( scan=exp,dest=exp2;( c= UCHARAT(scan++)); ) {    switch (c) {    case '(':
pike.git/src/modules/Regexp/pike_regexp.c:351:       /*    * If there's something expensive in the r.e., find the longest    * literal string that must appear and make it the regmust. Resolve    * ties in favor of later strings, since the regstart check works    * with the beginning of the r.e. and avoiding duplication    * strengthens checking. Not a strong reason, but sufficient in the    * absence of others.    */    if (flags & SPSTART) { -  longest = NULL; -  len = 0; +  char *longest = NULL; +  size_t len = 0;    for (; scan != NULL; scan = regnext(scan))    if (OP(scan) == EXACTLY &&    strlen(OPERAND(scan)) >= (size_t)len) {    longest = OPERAND(scan);    len = strlen(OPERAND(scan));    }    r->regmust = longest;    r->regmlen = len;    }    }