oksh-noxz

[fork] Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
git clone https://noxz.tech/git/oksh-noxz.git
oksh-noxz

commit: 5686a43a94dfe6a1217256a6d99991a0323f5f18
parent: bedf4ef8ceb512f485772a088217ddfa9abc184f
author: Brian Callahan <ibara@users.noreply.github.com>
date:   Thu, 4 Mar 2021 22:09:59 -0500
Fix up FreeBSD CTRL handling in vi mode

Not sure how great this is but it works. We can make it nicer later.
Fix #595686a43a94dfe6a1217256a6d99991a0323f5f18
 vi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vi.c b/vi.c
@@ -22,9 +22,12 @@
 #include "sh.h"
 #include "edit.h"
 
-#ifndef CTRL
-#define CTRL(c)	(c & 0x1f)
+#if !defined(CTRL) || defined(__FreeBSD__)
+#ifdef __FreeBSD__
+#undef CTRL
 #endif
+#define CTRL(c)	(c & 0x1f)
+#endif /* !CTRL || __FreeBSD__ */
 
 struct edstate {
 	char	*cbuf;		/* main buffer to build the command line */