Hi, lets's sync up vi.c with emacs.c and define CTRL locally. Makes the portable version work on FreeBSD https://github.com/ibara/oksh/issues/59 And as a bonus makes ksh -DSMALL compile with -DVI.
Greetings Ben Index: vi.c =================================================================== RCS file: /var/cvs/src/bin/ksh/vi.c,v retrieving revision 1.59 diff -u -p -r1.59 vi.c --- vi.c 10 Mar 2021 20:17:33 -0000 1.59 +++ vi.c 11 Mar 2021 10:13:07 -0000 @@ -22,6 +22,9 @@ #include "sh.h" #include "edit.h" +#undef CTRL +#define CTRL(x) ((x) == '?' ? 0x7F : (x) & 0x1F) /* ASCII */ + struct edstate { char *cbuf; /* main buffer to build the command line */ int cbufsize; /* number of bytes allocated for cbuf */