socsvn commit: r224266 - in soc2011/zy/nvi-iconv/head/contrib/nvi2:
. cl vi
zy at FreeBSD.org
zy at FreeBSD.org
Fri Jul 15 10:54:45 UTC 2011
Author: zy
Date: Fri Jul 15 10:54:43 2011
New Revision: 224266
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=224266
Log:
Merges git:dbebbe0. Known problems are solved, but:
* Display file with unsupported langinfo settings can cause program frozen. The problem also presents in nvi-1.8x.
Modified:
soc2011/zy/nvi-iconv/head/contrib/nvi2/README
soc2011/zy/nvi-iconv/head/contrib/nvi2/cl/cl_read.c
soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vi.c
soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vs_refresh.c
Modified: soc2011/zy/nvi-iconv/head/contrib/nvi2/README
==============================================================================
--- soc2011/zy/nvi-iconv/head/contrib/nvi2/README Fri Jul 15 09:37:14 2011 (r224265)
+++ soc2011/zy/nvi-iconv/head/contrib/nvi2/README Fri Jul 15 10:54:43 2011 (r224266)
@@ -1,6 +1,6 @@
-# $Id: README,v 8.154 2011/06/26 13:11:10 zy Exp $ (Berkeley) $Date: 2011/06/26 13:11:10 $
+# $Id: README,v 8.155 2011/07/15 04:45:07 zy Exp $ (Berkeley) $Date: 2011/07/15 04:45:07 $
-This is version 2.0.0 (2011-06-26) of nex/nvi, a reimplementation of the ex/vi
+This is version 2.0.0 (2011-07-11) 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.
@@ -18,6 +18,17 @@
vi ............ Vi source code.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+o Nvi was written by Keith Bostic, and the last version is 1.79. After that,
+
+ Sven Verdoolaege added the iconv support and the DB3 locking.
+
+ Jun-ichiro itojun Hagino developed the file encoding detection
+ techniques in his nvi-m17n.
+
+The following acknowledgments were written by Keith Bostic:
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
o This software is several years old and is the product of many folks' work.
This software was originally derived from software contributed to
Modified: soc2011/zy/nvi-iconv/head/contrib/nvi2/cl/cl_read.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/contrib/nvi2/cl/cl_read.c Fri Jul 15 09:37:14 2011 (r224265)
+++ soc2011/zy/nvi-iconv/head/contrib/nvi2/cl/cl_read.c Fri Jul 15 10:54:43 2011 (r224266)
@@ -314,7 +314,7 @@
a.len = SPRINTF(b1, sizeof(b1), L("lines=%lu"), (u_long)lines);
if (opts_set(sp, argv, NULL))
return (1);
- a.len = SPRINTF(b1, sizeof(b1), L("columns=%lu"), (u_long)lines);
+ a.len = SPRINTF(b1, sizeof(b1), L("columns=%lu"), (u_long)columns);
if (opts_set(sp, argv, NULL))
return (1);
return (0);
Modified: soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vi.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vi.c Fri Jul 15 09:37:14 2011 (r224265)
+++ soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vi.c Fri Jul 15 10:54:43 2011 (r224266)
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "$Id: vi.c,v 10.58 2011/06/26 20:20:42 zy Exp $ (Berkeley) $Date: 2011/06/26 20:20:42 $";
+static const char sccsid[] = "$Id: vi.c,v 10.59 2011/07/15 04:35:23 zy Exp $ (Berkeley) $Date: 2011/07/15 04:35:23 $";
#endif /* not lint */
#include <sys/types.h>
@@ -403,7 +403,6 @@
if (F_ISSET(gp, G_SRESTART) || F_ISSET(sp, SC_EX)) {
*spp = sp;
v_dtoh(sp);
- gp->scr_discard(sp, NULL);
break;
}
}
@@ -1016,15 +1015,11 @@
}
CIRCLEQ_REMOVE(&gp->dq, tsp, q);
CIRCLEQ_INSERT_TAIL(&gp->hq, tsp, q);
- /* XXXX Change if hidden screens per window */
- tsp->gp = 0;
- gp->scr_discard(tsp, NULL);
}
/* Move current screen back to the display queue. */
CIRCLEQ_REMOVE(&gp->hq, sp, q);
CIRCLEQ_INSERT_TAIL(&gp->dq, sp, q);
- sp->gp = gp;
if (hidden > 1)
msgq(sp, M_INFO,
Modified: soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vs_refresh.c
==============================================================================
--- soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vs_refresh.c Fri Jul 15 09:37:14 2011 (r224265)
+++ soc2011/zy/nvi-iconv/head/contrib/nvi2/vi/vs_refresh.c Fri Jul 15 10:54:43 2011 (r224266)
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "$Id: vs_refresh.c,v 10.45 2011/07/14 16:05:02 zy Exp $ (Berkeley) $Date: 2011/07/14 16:05:02 $";
+static const char sccsid[] = "$Id: vs_refresh.c,v 10.51 2011/07/15 03:32:07 zy Exp $ (Berkeley) $Date: 2011/07/15 03:32:07 $";
#endif /* not lint */
#include <sys/types.h>
@@ -345,7 +345,7 @@
tmp.lno = LNO;
tmp.coff = HMAP->coff;
tmp.soff = 1;
- lcnt = vs_sm_nlines(sp, &tmp, lastline, sp->t_rows);
+ lcnt = vs_sm_nlines(sp, &tmp, lastline+1, sp->t_rows);
if (lcnt < HALFTEXT(sp)) {
if (vs_sm_fill(sp, lastline, P_BOTTOM))
return (1);
@@ -507,8 +507,8 @@
* Count up the widths of the characters. If it's a tab
* character, go do it the the slow way.
*/
- for (cwtotal = 0; cnt--; cwtotal += KEY_LEN(sp, ch))
- if ((ch = *(u_char *)p--) == '\t')
+ for (cwtotal = 0; cnt--; cwtotal += KEY_COL(sp, ch))
+ if ((ch = *(UCHAR_T *)p--) == '\t')
goto slow;
/*
@@ -521,8 +521,8 @@
* If we're moving left, and there's a wide character in the
* current position, go to the end of the character.
*/
- if (KEY_LEN(sp, ch) > 1)
- cwtotal -= KEY_LEN(sp, ch) - 1;
+ if (KEY_COL(sp, ch) > 1)
+ cwtotal -= KEY_COL(sp, ch) - 1;
/*
* If the new column moved us off of the current logical line,
@@ -547,9 +547,9 @@
* screen boundary, we can quit.
*/
for (cwtotal = SCNO; cnt--;) {
- if ((ch = *(u_char *)p++) == '\t')
+ if ((ch = *(UCHAR_T *)p++) == '\t')
goto slow;
- if ((cwtotal += KEY_LEN(sp, ch)) >= SCREEN_COLS(sp))
+ if ((cwtotal += KEY_COL(sp, ch)) >= SCREEN_COLS(sp))
break;
}
@@ -804,13 +804,13 @@
++p;
break;
}
- if ((curlen += KEY_LEN(sp, *p)) > cols) {
+ if ((curlen += KEY_COL(sp, *p)) > cols) {
ellipsis = 3;
curlen +=
- KEY_LEN(sp, '.') * 3 + KEY_LEN(sp, ' ');
+ KEY_COL(sp, '.') * 3 + KEY_COL(sp, ' ');
while (curlen > cols) {
++p;
- curlen -= KEY_LEN(sp, *p);
+ curlen -= KEY_COL(sp, *p);
}
break;
}
@@ -818,13 +818,13 @@
if (ellipsis) {
while (ellipsis--)
(void)gp->scr_addstr(sp,
- KEY_NAME(sp, '.'), KEY_LEN(sp, '.'));
+ KEY_NAME(sp, '.'), KEY_COL(sp, '.'));
(void)gp->scr_addstr(sp,
- KEY_NAME(sp, ' '), KEY_LEN(sp, ' '));
+ KEY_NAME(sp, ' '), KEY_COL(sp, ' '));
}
for (; *p != '\0'; ++p)
(void)gp->scr_addstr(sp,
- KEY_NAME(sp, *p), KEY_LEN(sp, *p));
+ KEY_NAME(sp, *p), KEY_COL(sp, *p));
}
/* Clear the rest of the line. */
@@ -877,7 +877,7 @@
if (O_ISSET(sp, O_SHOWMODE)) {
if (F_ISSET(sp->ep, F_MODIFIED))
(void)gp->scr_addstr(sp,
- KEY_NAME(sp, '*'), KEY_LEN(sp, '*'));
+ KEY_NAME(sp, '*'), KEY_COL(sp, '*'));
(void)gp->scr_addstr(sp, t, len);
}
}
More information about the svn-soc-all
mailing list