On Sun, Nov 13, 2011 at 12:14:18PM +0100, Christian Weisgerber wrote:
nvi2 is a Google Summer of Code project by Zhihao Yuan for FreeBSD
that keeps the behaviors and the license of nvi-1.79 in the base
system and adopts the multibyte encoding support from nvi-1.8x.
This will be a potential path for adding multibyte support to our
base vi as well. I've attached a port for nvi-2.0.1 for people
who want to play with this now.
I just built it on sparc64.
Opened and edited a few files.
http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
looks good in it, too.
One problem is, that 'undo' (hitting 'u') leads to SIGBUS.
nvi UTF-8-demo.txt
delete random character with 'x'
undo with 'u'
BUS ERROR
I built nvi with -O0 -ggdb:
slayer:~$ gdb /usr/local/bin/nvi nvi.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB. Type show warranty for details.
This GDB was configured as sparc64-unknown-openbsd5.0...
Core was generated by `nvi'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libncursesw.so.12.1...done.
Loaded symbols for /usr/lib/libncursesw.so.12.1
Reading symbols from /usr/lib/libc.so.61.0...done.
Loaded symbols for /usr/lib/libc.so.61.0
Reading symbols from /usr/libexec/ld.so...done.
oaded symbols for /usr/libexec/ld.so
#0 0x0010b984 in default_int2char (sp=0x20ba29000, str=0x204feff1d,
len=62, cw=0x20ba29018, tolen=0x7448, pdst=0x7450,
enc=0x0) at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:276
276 n = wcrtomb(dst+j, str[i], mbs);
(gdb) bt
#0 0x0010b984 in default_int2char (sp=0x20ba29000, str=0x204feff1d,
len=62, cw=0x20ba29018, tolen=0x7448, pdst=0x7450,
enc=0x0) at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:276
#1 0x0010bc60 in fe_int2char (sp=0x20ba29000, str=0x204feff1d, len=62,
cw=0x20ba29018, tolen=0x7448, dst=0x7450) at
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/conv.c:314
#2 0x00115294 in db_set (sp=0x20ba29000, lno=2, p=0x204feff1d, len=62)
at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/line.c:442
#3 0x00116980 in log_backward (sp=0x20ba29000, rp=0x77f8)
at /usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/log.c:441
#4 0x0016f464 in v_undo (sp=0x20ba29000, vp=0x7768) at
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/vi/v_undo.c:128
#5 0x001723bc in vi (spp=0x7a28) at
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/vi/vi.c:233
#6 0x0011862c in editor (gp=0x20ba28000, argc=1,
argv=0x7dd0) at
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/common/main.c:425
#7 0x00105d94 in main (argc=2, argv=0x7dc8) at
/usr/ports/pobj/nvi-2.0.1/nvi2-2012/cl/cl_main.c:123
slayer:~$ sysctl kern.version
kern.version=OpenBSD 5.0-current (GENERIC.MP) #72: Thu Oct 27 12:49:59 MDT 2011
dera...@sparc64.openbsd.org:/usr/src/sys/arch/sparc64/compile/GENERIC.MP
Let me know if you need further information.
Regards,
--
Simon