Suggested by Robert Whitlock in PR bin/58177
I've sent this patch to the nvi maintainers but the response suggested
patching this downstream, as there would be no further releases of nvi.
most of these are like, eg
void foo(int[2]);
with either of these
void foo(int*) { ... }
void foo(int[]) { ... }
in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.
found by GCC 12.
Fix crash due to out-of-bounds access with Ctrl-W.
PR is only for nottywerase, but also fix ttywerase case, taken from
OpenBSD via nvi2:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/vi/vi/v_txt.c#rev1.235d5365d358
Also, comment there is no worry for altwerase specific code, which
seems suspicious at a glance.
Reported by Azuma OKAMOTO.
Thanks for detailed explanation how to reproduce the problem!
Remove const from the 2nd argument.
const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).
Keep the const form for the internal purposes inside citrus and rump.
Address the build breakage fallout in the same change.
There are no ABI changes.
Change accepted by core@.
avoid passing the same pointer in multiple arguments for restrict
marked arguments:
- sigaction() wants separate in/out
- use memmove() not memcpy() for overlapping regions (this may fix
a real bug in nvi -- but it seems unlikely)
- select() wants separate read/write/except
- sigprocmask() wants separate set/oset
nvi-m17n by itojun.
If imctrl option is set, input method is controlled by using escape
sequences compatible to Tera Term and RLogin. The state of input method in
commands specified by imkey option is saved and restored automatically.
Input method is then deactivated on returning to command mode.
Replace unportable manual calculation of alignof() that causes UB, with
a GCC extension __alignof__.
This fixes a problem reported by UBSan with the MKSANITIZER distribution.
- Replace non-printable multibyte char with ?-symbol.
- Put space before non-spacing char.
Fix problems reported in PR bin/53164 and
PR bin/53323, that are because we did not take into account non-printable
multibyte char of wctob(wc) == EOF && wcwidth(wc) == -1.
but only weird code?):
amd's amfs_program_exec() has a missing {} issue.
flex's check_options() has odd inconsistent identation that
trips the new ident checker.
ntpd's oncore_check_leap_sec() and oncore_set_traim() have
missing {} issues.
sntp's optionLoadNested() an identation weirdness that
trips the new ident checker.
vi's cl_attr() has a wrong {} issue, and its vs_paint() has
an identation weirdness that trips the new ident checker.
h_winch, test sa_handler against all SIG_* actions defined in sys/signal.h
instead of just 0. Corrects an issue where vi crashes after a window is
resized.