/* $Header: only.c,v 4.3 85/05/01 11:45:21 lwall Exp $
* Revision 4.3 85/05/01 11:45:21 lwall
* Baseline for release with 4.3bsd.
ngtodo
[maxngtodo
] = savestr(pat
);
compextodo
[maxngtodo
] = (COMPEX
*)safemalloc(sizeof(COMPEX
));
init_compex(compextodo
[maxngtodo
]);
compile(compextodo
[maxngtodo
],pat
,TRUE
,TRUE
);
if ((s
= ng_comp(compextodo
[maxngtodo
],pat
,TRUE
,TRUE
)) != Nullch
) {
/* compile regular expression */
printf("\n%s\n",s
) FLUSH
;
/* if command line list is non-null, is this newsgroup wanted? */
for (i
=0; i
<maxngtodo
; i
++) {
if (execute(compextodo
[i
],ngnam
))
for (i
=0; i
<maxngtodo
; i
++) {
if ((s
= ng_comp(&ilcompex
,ngtodo
[i
],TRUE
,TRUE
)) != Nullch
) {
/* compile regular expression */
printf("\n%s\n",s
) FLUSH
;
if (execute(&ilcompex
,ngnam
) != Nullch
) {
if (maxngtodo
) { /* did they specify newsgroup(s) */
printf("\nRestriction %s%s removed.\n",ngtodo
[0],
maxngtodo
> 1 ? ", etc." : nullstr
) FLUSH
;
fputs("\nExiting \"only\".\n",stdout
) FLUSH
;
for (whicharg
= 0; whicharg
< maxngtodo
; whicharg
++) {
free_compex(compextodo
[whicharg
]);
free((char*)compextodo
[whicharg
]);