text input: fix problem with autoindenting and ^^D
[nvi.git] / ex / ex_put.c
blobcd7e89e1d48fa231806304db673fc13f468fa6d3
1 /*-
2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1992, 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
8 */
10 #include "config.h"
12 #ifndef lint
13 static const char sccsid[] = "$Id: ex_put.c,v 10.8 2001/06/25 15:19:18 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:18 $";
14 #endif /* not lint */
16 #include <sys/types.h>
17 #include <sys/queue.h>
19 #include <bitstring.h>
20 #include <ctype.h>
21 #include <limits.h>
22 #include <stdio.h>
23 #include <string.h>
25 #include "../common/common.h"
28 * ex_put -- [line] pu[t] [buffer]
29 * Append a cut buffer into the file.
31 * PUBLIC: int ex_put __P((SCR *, EXCMD *));
33 int
34 ex_put(SCR *sp, EXCMD *cmdp)
36 MARK m;
38 NEEDFILE(sp, cmdp);
40 m.lno = sp->lno;
41 m.cno = sp->cno;
42 if (put(sp, NULL,
43 FL_ISSET(cmdp->iflags, E_C_BUFFER) ? &cmdp->buffer : NULL,
44 &cmdp->addr1, &m, 1))
45 return (1);
46 sp->lno = m.lno;
47 sp->cno = m.cno;
48 return (0);