* Bell Telephone Laboratories
/* ======== input output and file copying ======== */
f
->fdes
=fd
; f
->fsiz
=((flags
&(oneflg
|ttyflg
))==0 ? BUFSIZ
: 1);
f
->fnxt
=f
->fend
=f
->fbuf
; f
->feval
=0; f
->flin
=1;
f
->fend
=length(s
)+(f
->fnxt
=s
);
THEN IF f
->fdes
>=0 THEN
close(f
->fdes
) FI
IF
pipe(pv
)<0 ORF pv
[INPIPE
]<0 ORF pv
[OTPIPE
]<0
THEN
failed(idf
,badopen
);
IF f2
==0 THEN ioset
|=1 FI
THEN
failed(s
,badcreate
);
itos(serial
++); movstr(numbuf
,tmpnam
);
REG CHAR
*cline
, *clinep
;
ends
=mactrim(iop
->ioname
); IF nosubst THEN iop
->iofile
&= ~IODOC FI
iop
->ioname
=cpystak(tmpout
);
iop
->iolst
=iotemp
; iotemp
=iop
;
LOOP clinep
=cline
; chkpr(NL
);
WHILE (c
= (nosubst
? readc() : nextc(*ends
)), !eolchar(c
)) DO
*clinep
++ = c OD
IF eof ORF
eq(cline
,ends
) THEN
break FI
write(fd
,cline
,clinep
-cline
);