2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: ex_delete.c,v 8.4 1993/12/29 09:50:49 bostic Exp $ (Berkeley) $Date: 1993/12/29 09:50:49 $";
12 #include <sys/types.h>
18 * ex_delete: [line [,line]] d[elete] [buffer] [count] [flags]
20 * Delete lines from the file.
23 ex_delete(sp
, ep
, cmdp
)
32 F_ISSET(cmdp
, E_BUFFER
) ? cmdp
->buffer
: DEFCB
,
33 &cmdp
->addr1
, &cmdp
->addr2
, 1))
36 /* Delete the lines. */
37 if (delete(sp
, ep
, &cmdp
->addr1
, &cmdp
->addr2
, 1))
40 /* Set the cursor to the line after the last line deleted. */
41 sp
->lno
= cmdp
->addr1
.lno
;
43 /* Or the last line in the file if deleted to the end of the file. */
44 if (file_lline(sp
, ep
, &lno
))