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

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:790:       /* Be paranoid... */    if (prog == (regexp *)NULL || string == (char *)NULL) {    regerror("NULL parameter");    return (0);    }       /* If there is a "must appear" string, look for it. */    if (prog->regmust != (char *)NULL) {    s = string; -  while ((s = STRCHR(s, prog->regmust[0])) != (char *)NULL) { +  while ((s = strchr(s, prog->regmust[0])) != (char *)NULL) {    if (strncmp(s, prog->regmust, prog->regmlen) == 0)    break; /* Found it. */    s++;    }    if (s == (char *)NULL) /* Not present. */    return (0);    }    /* Mark beginning of line for ^ . */    regbol = string;       /* Simplest case: anchored match need be tried only once. */    if (prog->reganch)    return (regtry(prog, string));       /* Messy cases: unanchored match. */    s = string;    if (prog->regstart != '\0')    /* We know what char it must start with. */ -  while ((s = STRCHR(s, prog->regstart)) != (char *)NULL) { +  while ((s = strchr(s, prog->regstart)) != (char *)NULL) {    if (regtry(prog, s))    return (1);    s++;    }    else    /* We don't -- general case. */    do {    if (regtry(prog, s))    return (1);    } while (*s++ != '\0');
pike.git/src/modules/Regexp/pike_regexp.c:946:    if (*opnd != *reginput)    return (0);    len = strlen(opnd);    if (len > 1 && strncmp(opnd, reginput, len) != 0)    return (0);    reginput += len;    }    break;    case ANYOF:    if (*reginput == '\0' || -  STRCHR(OPERAND(scan), *reginput) == (char *)NULL) +  strchr(OPERAND(scan), *reginput) == (char *)NULL)    return (0);    reginput++;    break;    case ANYBUT:    if (*reginput == '\0' || -  STRCHR(OPERAND(scan), *reginput) != (char *)NULL) +  strchr(OPERAND(scan), *reginput) != (char *)NULL)    return (0);    reginput++;    break;    case NOTHING:    break;    case BACK:    break;       case BRANCH:{    register char *save;
pike.git/src/modules/Regexp/pike_regexp.c:1099:    count = strlen(scan);    scan += count;    break;    case EXACTLY:    while (*opnd == *scan) {    count++;    scan++;    }    break;    case ANYOF: -  while (*scan != '\0' && STRCHR(opnd, *scan) != (char *)NULL) { +  while (*scan != '\0' && strchr(opnd, *scan) != (char *)NULL) {    count++;    scan++;    }    break;    case ANYBUT: -  while (*scan != '\0' && STRCHR(opnd, *scan) == (char *)NULL) { +  while (*scan != '\0' && strchr(opnd, *scan) == (char *)NULL) {    count++;    scan++;    }    break;    default: /* Oh dear. Called inappropriately. */    regerror("internal foulup");    count = 0; /* Best compromise. */    break;    }    reginput = scan;