- case PRCC:
- case PRDATE:
- case PRFROM:
- case PRTO:
- case PRSUBJ:
- strncpy(temp, parswit[i].sw, sizeof(temp));
- temp[sizeof(temp) - 1] = '\0';
- dp = *brkstring (temp, " ", NULL);
- header: ;
- if (!(cp = nxtarg ())) {/* allow -xyz arguments */
- padvise (NULL, "missing argument to %s", argp[-2]);
- return NULL;
- }
- n = newnexus (GREPaction);
- n->n_header = 1;
- snprintf (buffer, sizeof(buffer), "^%s[ \t]*:.*%s", dp, cp);
- dp = buffer;
- goto pattern;
-
- case PRSRCH:
- n = newnexus (GREPaction);
- n->n_header = 0;
- if (!(cp = nxtarg ())) {/* allow -xyz arguments */
- padvise (NULL, "missing argument to %s", argp[-2]);
- return NULL;
- }
- dp = cp;
- pattern: ;
- if (!gcompile (n, dp)) {
- padvise (NULL, "pattern error in %s %s", argp[-2], cp);
- return NULL;
- }
- n->n_patbuf = getcpy (dp);
- return n;