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.6 1994/01/11 22:18:38 bostic Exp $ (Berkeley) $Date: 1994/01/11 22:18:38 $";
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
)
31 if (cut(sp
, ep
, NULL
, F_ISSET(cmdp
, E_BUFFER
) ? &cmdp
->buffer
: NULL
,
32 &cmdp
->addr1
, &cmdp
->addr2
, CUT_DELETE
| CUT_LINEMODE
))
35 /* Delete the lines. */
36 if (delete(sp
, ep
, &cmdp
->addr1
, &cmdp
->addr2
, 1))
39 /* Set the cursor to the line after the last line deleted. */
40 sp
->lno
= cmdp
->addr1
.lno
;
42 /* Or the last line in the file if deleted to the end of the file. */
43 if (file_lline(sp
, ep
, &lno
))