* Copyright (c) 1992 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Rodney Ruddock of the University of Guelph.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)t.c 5.4 (Berkeley) %G%";
* The transcribe function. POSIX calls it copy, but 't' for transcribe
* is more mneumonic and that's what I've always called it. Transcribes
* the spec'd lines into the buffer at the spec'd location.
LINE
*l_ptr
, *l_tb
, *l_te
, *l_temp1
, *l_temp2
, *l_dest
=NULL
;
if (((ss
= getc(inputt
)) != '\n') && (ss
!= EOF
)) {
l_dest
= address_conv(NULL
, inputt
, errnum
);
(ungetc(ss
, inputt
), *errnum
= -1);
strcpy(help_msg
, "bad destination address");
if (Start_default
&& End_default
)
strcpy(help_msg
, "empty buffer");
Start_default
= End_default
= 0;
for (l_ptr
= Start
; l_ptr
!= (End
->below
); l_ptr
= (l_ptr
->below
)) {
get_line(l_ptr
->handle
, l_ptr
->len
);
if (sigint_flag
&& (!sigspecial
))
l_temp1
= (LINE
*) malloc(sizeof(LINE
));
strcpy(help_msg
, "out of memory error");
(l_temp1
->len
) = l_ptr
->len
;
/* add it into the buffer at the spec'd location */
(l_temp1
->handle
) = add_line(text
, l_ptr
->len
);
if (sigint_flag
&& (!sigspecial
))
u_add_stk(&(l_dest
->below
));
u_add_stk(&(top
->above
));
u_add_stk(&(l_temp2
->above
));