version 1.6, 1993/06/14 19:59:07 |
version 1.7, 1993/07/20 00:29:41 |
Line 542 struct val *a, *b; |
|
Line 542 struct val *a, *b; |
|
regmatch_t rm[SE_MAX]; |
regmatch_t rm[SE_MAX]; |
char errbuf[256]; |
char errbuf[256]; |
int eval; |
int eval; |
char *newpat; |
|
struct val *v; |
struct val *v; |
|
|
/* patterns are anchored to the beginning of the line */ |
/* coerce to both arguments to strings */ |
newpat = malloc (strlen (b->u.s) + 2); |
to_string(a); |
strcpy (newpat, "^"); |
to_string(b); |
strcat (newpat, b->u.s); |
|
|
|
/* compile regular expression */ |
/* compile regular expression */ |
if ((eval = regcomp (&rp, newpat, 0)) != 0) { |
if ((eval = regcomp (&rp, b->u.s, 0)) != 0) { |
regerror (eval, &rp, errbuf, sizeof(errbuf)); |
regerror (eval, &rp, errbuf, sizeof(errbuf)); |
fprintf (stderr, "expr: %s\n", errbuf); |
fprintf (stderr, "expr: %s\n", errbuf); |
exit (2); |
exit (2); |