/* tipout.c 4.6 82/01/06 */
* lower fork of tip -- handles passive side
* reading from the remote host
* TIPOUT wait state routine --
* sent by TIPIN when it wants to posses the remote host
* Scripting command interpreter --
* accepts script file name over the pipe and acts accordingly
register char *pline
= line
;
if (boolean(value(SCRIPT
)) && fscript
!= NULL
)
boolean(value(SCRIPT
)) = FALSE
;
if ((fscript
= fopen(line
, "a")) == NULL
)
boolean(value(SCRIPT
)) = TRUE
;
write(repdes
[1], &reply
, 1);
signal(SIGTERM
, SIG_IGN
);
if (boolean(value(SCRIPT
)) && fscript
!= NULL
)
boolean(value(BEAUTIFY
)) = !boolean(value(BEAUTIFY
));
signal(SIGQUIT
, SIG_IGN
);
signal(SIGEMT
, intEMT
); /* attention from TIPIN */
signal(SIGTERM
, intTERM
); /* time to go signal */
signal(SIGIOT
, intIOT
); /* scripting going on signal */
signal(SIGHUP
, intTERM
); /* for dial-ups */
signal(SIGSYS
, intSYS
); /* beautify toggle */
cnt
= read(FD
, buf
, BUFSIZ
);
for (cp
= buf
; cp
< buf
+ cnt
; cp
++)
if (boolean(value(SCRIPT
)) && fscript
!= NULL
) {
if (!boolean(value(BEAUTIFY
))) {
fwrite(buf
, 1, cnt
, fscript
);
for (cp
= buf
; cp
< buf
+ cnt
; cp
++) {
if (*cp
< ' ' && !any(*cp
, value(EXCEPTIONS
)))