regsubcomp.c revision 1
1N/A#pragma prototyped
1N/Aregsubflags(regex_t* p, register const char* s, char** e, int delim, register const regflags_t* map, int* pm, regflags_t* pf)
1N/A register const regflags_t* m;
1N/Aregsubcomp(regex_t* p, register const char* s, const regflags_t* map, int minmatch, regflags_t flags)
1N/A if (!(sub = (regsub_t*)alloc(p->env->disc, 0, sizeof(regsub_t) + strlen(s))) || !(sub->re_ops = (regsubop_t*)alloc(p->env->disc, 0, (nops = 8) * sizeof(regsubop_t))))
1N/A case REG_SUB_UPPER:
1N/A case REG_SUB_LOWER:
if (isupper(c))
c = tolower(c);
else if (islower(c))
c = toupper(c);
if (isupper(c))
c = tolower(c);
if (islower(c))
c = toupper(c);
set:
if (!(sub->re_ops = (regsubop_t*)alloc(p->env->disc, sub->re_ops, (nops *= 2) * sizeof(regsubop_t))))
regfree(p);
f = REG_SUB_LOWER;
goto set;
f = REG_SUB_UPPER;
goto set;
if (!sre)
if (c > p->re_nsub)
regfree(p);
if (!(sub->re_ops = (regsubop_t*)alloc(p->env->disc, sub->re_ops, (nops *= 2) * sizeof(regsubop_t))))
regfree(p);
op++;
op++;
if (!(sub->re_ops = (regsubop_t*)alloc(p->env->disc, sub->re_ops, (nops *= 2) * sizeof(regsubop_t))))
regfree(p);
p->re_sub = 0;