PR/45881: Chavdar Ivanov: nvi copy command copies empty lines.
Move ENTIRE_LINE definition to common.h and have interested parties use it.
This commit is contained in:
parent
2ee3a9cdc8
commit
1ed18fbd3b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: common.h,v 1.2 2008/05/20 17:38:19 aymeric Exp $ */
|
||||
/* $NetBSD: common.h,v 1.3 2012/01/27 16:41:22 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
|
@ -85,6 +85,7 @@ typedef enum { LOCK_FAILED, LOCK_SUCCESS, LOCK_UNAVAIL } lockr_t;
|
|||
/* Sequence types. */
|
||||
typedef enum { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT } seq_t;
|
||||
|
||||
#define ENTIRE_LINE ((size_t)-1)
|
||||
/*
|
||||
* Local includes.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cut.c,v 1.8 2012/01/21 19:56:46 christos Exp $ */
|
||||
/* $NetBSD: cut.c,v 1.9 2012/01/27 16:41:22 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993, 1994
|
||||
|
@ -134,7 +134,6 @@ copyloop:
|
|||
}
|
||||
|
||||
|
||||
#define ENTIRE_LINE (size_t)-1
|
||||
/* In line mode, it's pretty easy, just cut the lines. */
|
||||
if (LF_ISSET(CUT_LINEMODE)) {
|
||||
cbp->flags |= CB_LMODE;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: delete.c,v 1.5 2012/01/21 19:49:56 christos Exp $ */
|
||||
/* $NetBSD: delete.c,v 1.6 2012/01/27 16:41:22 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993, 1994
|
||||
|
@ -65,7 +65,7 @@ del(SCR *sp, MARK *fm, MARK *tm, int lmode)
|
|||
if (tm->lno == lno) {
|
||||
if (db_get(sp, lno, DBG_FATAL, &p, &len))
|
||||
return (1);
|
||||
eof = tm->cno != (size_t)-1 && tm->cno >= len ? 1 : 0;
|
||||
eof = tm->cno != ENTIRE_LINE && tm->cno >= len ? 1 : 0;
|
||||
} else
|
||||
eof = 1;
|
||||
if (eof) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ex_move.c,v 1.1.1.2 2008/05/18 14:31:16 aymeric Exp $ */
|
||||
/* $NetBSD: ex_move.c,v 1.2 2012/01/27 16:41:22 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993, 1994
|
||||
|
@ -54,7 +54,7 @@ ex_copy(SCR *sp, EXCMD *cmdp)
|
|||
memset(&cb, 0, sizeof(cb));
|
||||
CIRCLEQ_INIT(&cb.textq);
|
||||
for (cnt = fm1.lno; cnt <= fm2.lno; ++cnt)
|
||||
if (cut_line(sp, cnt, 0, 0, &cb)) {
|
||||
if (cut_line(sp, cnt, 0, ENTIRE_LINE, &cb)) {
|
||||
rval = 1;
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue