Module Name: src
Committed By: sborrill
Date: Sun Oct 18 09:58:03 UTC 2009
Modified Files:
src/dist/nvi/common [netbsd-5]: multibyte.h options.c
src/dist/nvi/ex [netbsd-5]: ex_shift.c ex_txt.c version.h
src/dist/nvi/vi [netbsd-5]: v_ex.c v_increment.c v_txt.c
Log Message:
Pull up the following revisions(s) (requested by aymeric in ticket #1068):
dist/nvi/common/multibyte.h: revision 1.4
dist/nvi/vi/v_increment.c: revision 1.4
dist/nvi/vi/v_ex.c: revision 1.4
dist/nvi/common/options.c: revision 1.6
dist/nvi/ex/ex_shift.c: revision 1.3
dist/nvi/ex/ex_txt.c: revision 1.4
dist/nvi/ex/version.h: revision 1.4 via patch
dist/nvi/vi/v_txt.c: revision 1.6
Update to nvi-1.81.6nb5:
- Make :ESC, #+ and #- work again.
- Rename "expandtabs" to "expandtab" to match documentation.
- Implement the "et" abbreviation for expandtab.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.6.2 -r1.1.1.2.6.3 src/dist/nvi/common/multibyte.h
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/dist/nvi/common/options.c
cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 src/dist/nvi/ex/ex_shift.c
cvs rdiff -u -r1.1.1.2.6.2 -r1.1.1.2.6.3 src/dist/nvi/ex/ex_txt.c
cvs rdiff -u -r1.1.1.1.8.1 -r1.1.1.1.8.2 src/dist/nvi/ex/version.h
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/dist/nvi/vi/v_ex.c
cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 src/dist/nvi/vi/v_increment.c
cvs rdiff -u -r1.1.1.2.6.3 -r1.1.1.2.6.4 src/dist/nvi/vi/v_txt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/dist/nvi/common/multibyte.h
diff -u src/dist/nvi/common/multibyte.h:1.1.1.2.6.2 src/dist/nvi/common/multibyte.h:1.1.1.2.6.3
--- src/dist/nvi/common/multibyte.h:1.1.1.2.6.2 Mon Apr 13 20:59:20 2009
+++ src/dist/nvi/common/multibyte.h Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: multibyte.h,v 1.1.1.2.6.2 2009/04/13 20:59:20 snj Exp $ */
+/* $NetBSD: multibyte.h,v 1.1.1.2.6.3 2009/10/18 09:58:03 sborrill Exp $ */
#ifndef MULTIBYTE_H
#define MULTIBYTE_H
@@ -24,6 +24,7 @@
#define STRPBRK wcspbrk
#define TOUPPER towupper
#define STRSET wmemset
+#define STRCHR wcschr
#define L(ch) L ## ch
@@ -41,6 +42,7 @@
#define STRPBRK strpbrk
#define TOUPPER toupper
#define STRSET memset
+#define STRCHR strchr
#define L(ch) ch
Index: src/dist/nvi/common/options.c
diff -u src/dist/nvi/common/options.c:1.3.2.2 src/dist/nvi/common/options.c:1.3.2.3
--- src/dist/nvi/common/options.c:1.3.2.2 Tue Jan 20 02:56:07 2009
+++ src/dist/nvi/common/options.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.3.2.2 2009/01/20 02:56:07 snj Exp $ */
+/* $NetBSD: options.c,v 1.3.2.3 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -84,8 +84,8 @@
{L("errorbells"), NULL, OPT_0BOOL, 0},
/* O_ESCAPETIME 4.4BSD */
{L("escapetime"), NULL, OPT_NUM, 0},
-/* O_EXPANDTABS NetBSD 5.0 */
- {L("expandtabs"), NULL, OPT_0BOOL, 0},
+/* O_EXPANDTAB NetBSD 5.0 */
+ {L("expandtab"), NULL, OPT_0BOOL, 0},
/* O_EXRC System V (undocumented) */
{L("exrc"), NULL, OPT_0BOOL, 0},
/* O_EXTENDED 4.4BSD */
@@ -267,6 +267,7 @@
{L("dir"), O_TMP_DIRECTORY}, /* 4BSD */
{L("eb"), O_ERRORBELLS}, /* 4BSD */
{L("ed"), O_EDCOMPATIBLE}, /* 4BSD */
+ {L("et"), O_EXPANDTAB}, /* NetBSD 5.0 */
{L("ex"), O_EXRC}, /* System V (undocumented) */
#ifdef GTAGS
{L("gt"), O_GTAGSMODE}, /* FreeBSD, NetBSD */
Index: src/dist/nvi/ex/ex_shift.c
diff -u src/dist/nvi/ex/ex_shift.c:1.1.1.2.6.1 src/dist/nvi/ex/ex_shift.c:1.1.1.2.6.2
--- src/dist/nvi/ex/ex_shift.c:1.1.1.2.6.1 Tue Jan 20 02:56:07 2009
+++ src/dist/nvi/ex/ex_shift.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_shift.c,v 1.1.1.2.6.1 2009/01/20 02:56:07 snj Exp $ */
+/* $NetBSD: ex_shift.c,v 1.1.1.2.6.2 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -135,7 +135,7 @@
*/
tbp = bp;
newidx = 0;
- if (!O_ISSET(sp, O_EXPANDTABS)) {
+ if (!O_ISSET(sp, O_EXPANDTAB)) {
for (; newcol >= O_VAL(sp, O_TABSTOP); ++newidx) {
*tbp++ = '\t';
newcol -= O_VAL(sp, O_TABSTOP);
Index: src/dist/nvi/ex/ex_txt.c
diff -u src/dist/nvi/ex/ex_txt.c:1.1.1.2.6.2 src/dist/nvi/ex/ex_txt.c:1.1.1.2.6.3
--- src/dist/nvi/ex/ex_txt.c:1.1.1.2.6.2 Tue Jan 20 02:56:07 2009
+++ src/dist/nvi/ex/ex_txt.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_txt.c,v 1.1.1.2.6.2 2009/01/20 02:56:07 snj Exp $ */
+/* $NetBSD: ex_txt.c,v 1.1.1.2.6.3 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -407,7 +407,7 @@
*/
cno = 0;
tabs = 0;
- if (!O_ISSET(sp, O_EXPANDTABS)) {
+ if (!O_ISSET(sp, O_EXPANDTAB)) {
for (; cno + COL_OFF(cno, ts) <= scno; ++tabs)
cno += COL_OFF(cno, ts);
}
Index: src/dist/nvi/ex/version.h
diff -u src/dist/nvi/ex/version.h:1.1.1.1.8.1 src/dist/nvi/ex/version.h:1.1.1.1.8.2
--- src/dist/nvi/ex/version.h:1.1.1.1.8.1 Tue Jan 20 02:57:34 2009
+++ src/dist/nvi/ex/version.h Sun Oct 18 09:58:03 2009
@@ -1,3 +1,3 @@
-/* $NetBSD: version.h,v 1.1.1.1.8.1 2009/01/20 02:57:34 snj Exp $ */
+/* $NetBSD: version.h,v 1.1.1.1.8.2 2009/10/18 09:58:03 sborrill Exp $ */
-#define VI_VERSION "nvi-1.81.6nb1 (2007-11-18)"
+#define VI_VERSION "nvi-1.81.6nb5 (2009-08-11)"
Index: src/dist/nvi/vi/v_ex.c
diff -u src/dist/nvi/vi/v_ex.c:1.2.2.1 src/dist/nvi/vi/v_ex.c:1.2.2.2
--- src/dist/nvi/vi/v_ex.c:1.2.2.1 Tue Jan 20 02:41:13 2009
+++ src/dist/nvi/vi/v_ex.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: v_ex.c,v 1.2.2.1 2009/01/20 02:41:13 snj Exp $ */
+/* $NetBSD: v_ex.c,v 1.2.2.2 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -528,6 +528,7 @@
new->frp = wp->ccl_sp->frp;
new->frp->flags = sp->frp->flags;
+ new->conv = wp->ccl_sp->conv;
/* Move the cursor to the end. */
(void)db_last(new, &new->lno);
Index: src/dist/nvi/vi/v_increment.c
diff -u src/dist/nvi/vi/v_increment.c:1.1.1.2.6.1 src/dist/nvi/vi/v_increment.c:1.1.1.2.6.2
--- src/dist/nvi/vi/v_increment.c:1.1.1.2.6.1 Tue Jan 20 02:41:13 2009
+++ src/dist/nvi/vi/v_increment.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: v_increment.c,v 1.1.1.2.6.1 2009/01/20 02:41:13 snj Exp $ */
+/* $NetBSD: v_increment.c,v 1.1.1.2.6.2 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -30,17 +30,17 @@
#include "../common/common.h"
#include "vi.h"
-static const char * const fmt[] = {
+static const CHAR_T * const fmt[] = {
#define DEC 0
- "%ld",
+ L("%ld"),
#define SDEC 1
- "%+ld",
+ L("%+ld"),
#define HEXC 2
- "0X%0*lX",
+ L("0X%0*lX"),
#define HEXL 3
- "0x%0*lx",
+ L("0x%0*lx"),
#define OCTAL 4
- "%#0*lo",
+ L("%#0*lo"),
};
static void inc_err __P((SCR *, enum nresult));
@@ -59,8 +59,8 @@
long change, ltmp, lval;
size_t beg, blen, end, len, nlen, wlen;
int base, isempty, rval;
- const char *ntype;
- char nbuf[100];
+ const CHAR_T *ntype;
+ CHAR_T nbuf[100];
CHAR_T *bp, *p, *t;
/* Validate the operator. */
@@ -102,7 +102,7 @@
}
#undef ishex
-#define ishex(c) (isdigit(c) || strchr("abcdefABCDEF", c))
+#define ishex(c) (isdigit(c) || STRCHR(L("abcdefABCDEF"), c))
#undef isoctal
#define isoctal(c) (isdigit(c) && (c) != '8' && (c) != '9')
@@ -205,7 +205,7 @@
/* If we cross 0, signed numbers lose their sign. */
if (lval == 0 && ntype == fmt[SDEC])
ntype = fmt[DEC];
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, lval);
+ nlen = SPRINTF(nbuf, sizeof(nbuf), ntype, lval);
} else {
if ((nret = nget_uslong(sp, &ulval, t, NULL, base)) != NUM_OK)
goto err;
@@ -227,7 +227,7 @@
if (base == 16)
wlen -= 2;
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, wlen, ulval);
+ nlen = SPRINTF(nbuf, sizeof(nbuf), ntype, wlen, ulval);
}
/* Build the new line. */
Index: src/dist/nvi/vi/v_txt.c
diff -u src/dist/nvi/vi/v_txt.c:1.1.1.2.6.3 src/dist/nvi/vi/v_txt.c:1.1.1.2.6.4
--- src/dist/nvi/vi/v_txt.c:1.1.1.2.6.3 Tue Jan 20 03:05:01 2009
+++ src/dist/nvi/vi/v_txt.c Sun Oct 18 09:58:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: v_txt.c,v 1.1.1.2.6.3 2009/01/20 03:05:01 snj Exp $ */
+/* $NetBSD: v_txt.c,v 1.1.1.2.6.4 2009/10/18 09:58:03 sborrill Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -1724,16 +1724,16 @@
/*
* If there are no spaces, or no tabs after spaces and less than
* ts spaces, it's already minimal.
- * Keep analysing if expandtabs is set.
+ * Keep analysing if expandtab is set.
*/
if ((!spaces || (!tab_after_sp && spaces < ts)) &&
- !O_ISSET(sp, O_EXPANDTABS))
+ !O_ISSET(sp, O_EXPANDTAB))
return;
/* Count up spaces/tabs needed to get to the target. */
cno = 0;
tabs = 0;
- if (!O_ISSET(sp, O_EXPANDTABS)) {
+ if (!O_ISSET(sp, O_EXPANDTAB)) {
for (; cno + COL_OFF(cno, ts) <= scno; ++tabs)
cno += COL_OFF(cno, ts);
}
@@ -1961,7 +1961,7 @@
else {
cno = current;
tabs = 0;
- if (!O_ISSET(sp, O_EXPANDTABS)) {
+ if (!O_ISSET(sp, O_EXPANDTAB)) {
for (; cno + COL_OFF(cno, ts) <= target; ++tabs)
cno += COL_OFF(cno, ts);
}