PR/10367: Mason Loring Bliss: fix delete word near end of file. Patch

from tnozaki.
This commit is contained in:
christos 2012-01-21 17:12:56 +00:00
parent caaf3a9421
commit 9e2c491108
2 changed files with 13 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: delete.c,v 1.1.1.2 2008/05/18 14:29:41 aymeric Exp $ */
/* $NetBSD: delete.c,v 1.2 2012/01/21 17:12:56 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -89,6 +89,11 @@ del(SCR *sp, MARK *fm, MARK *tm, int lmode)
/* Case 3 -- delete within a single line. */
if (tm->lno == fm->lno) {
if (tm->cno == fm->cno) {
if (db_delete(sp, fm->lno))
return (1);
goto done;
}
if (db_get(sp, fm->lno, DBG_FATAL, &p, &len))
return (1);
GET_SPACE_RETW(sp, bp, blen, len);

10
dist/nvi/vi/getc.c vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: getc.c,v 1.3 2011/03/21 14:53:04 tnozaki Exp $ */
/* $NetBSD: getc.c,v 1.4 2012/01/21 17:12:56 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -143,10 +143,12 @@ cs_fspace(SCR *sp, VCS *csp)
int
cs_fblank(SCR *sp, VCS *csp)
{
if (csp->cs_flags == CS_EMP)
return (0);
for (;;) {
if (cs_next(sp, csp))
return (1);
if (csp->cs_flags == CS_EOL || csp->cs_flags == CS_EMP ||
if (csp->cs_flags == CS_EOL ||
(csp->cs_flags == 0 && ISBLANK2(csp->cs_ch)))
continue;
break;
@ -212,10 +214,12 @@ cs_prev(SCR *sp, VCS *csp)
int
cs_bblank(SCR *sp, VCS *csp)
{
if (csp->cs_flags == CS_EMP)
return (0);
for (;;) {
if (cs_prev(sp, csp))
return (1);
if (csp->cs_flags == CS_EOL || csp->cs_flags == CS_EMP ||
if (csp->cs_flags == CS_EOL ||
(csp->cs_flags == 0 && ISBLANK2(csp->cs_ch)))
continue;
break;