Merge nvi-2.1.1 -> 2.1.2

This commit is contained in:
Peter Wemm 2013-11-11 16:52:02 +00:00
commit 9d9df6f478
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257999
7 changed files with 2339 additions and 1203 deletions

View File

@ -1,6 +1,6 @@
# $Id: README,v 9.0 2012/10/07 09:13:54 zy Exp $
# $Id: README,v 9.1 2013/11/02 02:50:23 zy Exp $
This is version 2.1.1 (2012-10-07) of nex/nvi, a reimplementation of the ex/vi
This is version 2.1.2 (2012-11-02) of nex/nvi, a reimplementation of the ex/vi
text editors originally distributed as part of the Fourth Berkeley
Software Distribution (4BSD), by the University of California, Berkeley.

View File

@ -11,9 +11,9 @@
#ifndef lint
static const char copyright[] =
"%Z% Copyright (c) 1992, 1993, 1994\n\
"@(#) Copyright (c) 1992, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n\
%Z% Copyright (c) 1992, 1993, 1994, 1995, 1996\n\
@(#) Copyright (c) 1992, 1993, 1994, 1995, 1996\n\
Keith Bostic. All rights reserved.\n";
#endif /* not lint */

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
static const char sccsid[] = "$Id: ex_print.c,v 10.25 2011/12/12 22:12:20 zy Exp $";
static const char sccsid[] = "$Id: ex_print.c,v 10.26 2013/11/02 02:11:07 zy Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -213,7 +213,7 @@ ex_prchars(SCR *sp, const CHAR_T *p, size_t *colp, size_t len,
gp = sp->gp;
ts = O_VAL(sp, O_TABSTOP);
for (col = *colp; len--;)
if ((ch = *p++) == '\t' && !LF_ISSET(E_C_LIST))
if ((ch = *p++) == L('\t') && !LF_ISSET(E_C_LIST))
for (tlen = ts - col % ts;
col < sp->cols && tlen--; ++col) {
(void)ex_printf(sp,
@ -223,21 +223,32 @@ ex_prchars(SCR *sp, const CHAR_T *p, size_t *colp, size_t len,
}
else {
kp = KEY_NAME(sp, ch);
tlen = KEY_LEN(sp, ch);
if (!repeatc && col + tlen < sp->cols) {
tlen = KEY_COL(sp, ch);
/*
* Start a new line if the last character does not fit
* into the current line. The implicit new lines are
* not interruptible.
*/
if (col + tlen > sp->cols) {
col = 0;
(void)ex_puts(sp, "\n");
}
col += tlen;
if (!repeatc) {
(void)ex_puts(sp, kp);
col += tlen;
} else
for (; tlen--; ++kp, ++col) {
if (col == sp->cols) {
col = 0;
(void)ex_puts(sp, "\n");
}
(void)ex_printf(sp,
"%c", repeatc ? repeatc : *kp);
if (INTERRUPTED(sp))
goto intr;
}
if (INTERRUPTED(sp))
goto intr;
} else while (tlen--) {
(void)ex_printf(sp, "%c", repeatc);
if (INTERRUPTED(sp))
goto intr;
}
if (col == sp->cols) {
col = 0;
(void)ex_puts(sp, "\n");
}
}
intr: *colp = col;
return (0);

View File

@ -1 +1 @@
#define VI_VERSION "2.1.1 (2012-10-07)"
#define VI_VERSION "2.1.2 (2012-11-02)"

View File

@ -295,7 +295,8 @@ v_txt(
tiqh = sp->tiq;
if (!TAILQ_EMPTY(tiqh)) {
tp = TAILQ_FIRST(tiqh);
if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < len + 32) {
if (TAILQ_NEXT(tp, q) != NULL ||
tp->lb_len < (len + 32) * sizeof(CHAR_T)) {
text_lfree(tiqh);
goto newtp;
}

View File

@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
static const char sccsid[] = "$Id: vs_refresh.c,v 10.52 2011/12/16 11:06:25 zy Exp $";
static const char sccsid[] = "$Id: vs_refresh.c,v 10.53 2013/11/01 11:57:36 zy Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -331,7 +331,8 @@ small_fill: (void)gp->scr_move(sp, LASTLINE(sp), 0);
if (vs_sm_1down(sp))
return (1);
goto adjust;
}
} else
goto top; /* XXX No such line. */
/*
* If less than a half screen from the bottom of the file,