* 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
[] = "@(#)m.c 5.3 (Berkeley) %G%";
* Move the specified lines to the new location. It's quick 'cause
* just a couple of pointers are redirected.
LINE
*l_dest
=NULL
, *l_old_top
, *l_old_bottom
;
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
, "buffer empty");
start_default
= End_default
= 0;
/* Do some address checking. */
if ((l_dest
) && ((l_dest
== start
) ||
(address_check(l_dest
, start
) == -1)) &&
(address_check(End
, l_dest
) == -1)) {
strcpy(help_msg
, "destination address in address range");
* Some more address checking. These are "legal" command constructions
* but are kind-a useless since the buffer doesn't change.
if ((start
== l_dest
) || (End
== l_dest
))
if ((start
== top
) && (End
== bottom
))
if ((start
== top
) && (l_dest
== NULL
))
u_add_stk(&(End
->below
->above
));
u_add_stk(&(start
->above
->below
));
u_add_stk(&(start
->above
->below
));
start
->above
->below
= End
->below
;
u_add_stk(&(End
->below
->above
));
End
->below
->above
= start
->above
;
u_add_stk(&(start
->above
));
u_add_stk(&(End
->below
));
u_add_stk(&(l_old_top
->above
));
if (l_dest
== l_old_bottom
) {
u_add_stk(&(End
->below
));
u_add_stk(&(start
->above
));
u_add_stk(&(l_dest
->below
));
u_add_stk(&(start
->above
));
u_add_stk(&(End
->below
));
End
->below
= l_dest
->below
;
u_add_stk(&(l_dest
->below
->above
));
l_dest
->below
->above
= End
;
u_add_stk(&(l_dest
->below
));