static char *sccsid
= "@(#)glue4.c 4.3 (Berkeley) %G%";
char line
[200], *s
, argig
[100], *cv
[50];
int c
, oldc
= 0, alph
= 0, nv
= 0;
sprintf(gfile
, "%s/rj%dg", _PATH_TMP
, getpid());
fprintf(stderr
, "in grepcall, gfile %s in %o out %o\n", gfile
,in
,out
);
for(cv
[nv
++] = "fgrep"; c
= *inp
; inp
++)
alph
= (c
==0) ? 0 : alph
+1;
fprintf(stderr
, "%d args set up\n", nv
);
if (open (argig
, 0) != 0)
err("Can't read fgrep index %s", argig
);
if (creat(gfile
, 0666) != 1)
err("Can't write fgrep output %s", gfile
);
fprintf(stderr
, "fgrep returned, output is..\n");
fprintf(stderr
, "back from fgrep\n");
err("can't read fgrep output %s", gfile
);
while (fgets(line
, 100, gf
) == line
)
fprintf(stderr
, "read line as //%s//\n",line
);
for(s
=line
; *s
&& (*s
!= '\t'); s
++);
fprintf(stderr
, "out now /%s/\n",out
);
fprintf(stderr
, "line %o s %o s-1 %o\n",line
,s
,s
[-1]);
while (!feof(gf
) && getc(gf
)!= '\n') ;
fprintf(stderr
, "back from reading %, out %s\n",out
);