summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhhvn <dev@hhvn.uk>2026-05-22 21:25:44 +0100
committerhhvn <dev@hhvn.uk>2026-05-22 22:03:43 +0100
commitf83007fea75c9b70a2a08bfa22a88fd5b50fed67 (patch)
treeac74354017583e01b9db2e25c83d04edf11919a1
parent607ea6e5e7b86c57a2f50b21b5f86418b3d40ec8 (diff)
Prevent use of non-available readline functions
-rw-r--r--edit-readline.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/edit-readline.c b/edit-readline.c
index dcaa51b..2e48fd2 100644
--- a/edit-readline.c
+++ b/edit-readline.c
@@ -11,6 +11,35 @@
#include "edit.h"
+/* A number of readline functions used in this file are not
+ * present in the version of readline supplied on OpenBSD.
+ * These are replaced with no-ops.
+ * This does not seem to have any major effect other than
+ * ruining the completion of quoted strings. */
+#if RL_VERSION_MAJOR < 5
+typedef char *rl_cpvfunc_t (void);
+rl_cpvfunc_t *rl_completion_word_break_hook;
+int rl_bind_keyseq (const char *s, rl_command_func_t *f) {
+ (void)s;
+ (void)f;
+ return 0;
+}
+histdata_t free_history_entry (HIST_ENTRY *e) {
+ (void)e;
+ return (histdata_t){};
+}
+#endif
+
+#if RL_VERSION_MAJOR < 5 || (RL_VERSION_MAJOR == 5 && RL_VERSION_MINOR < 1)
+int rl_reset_screen_size(void) {
+ return 0;
+}
+#endif
+
+#if RL_VERSION_MAJOR < 6
+int rl_sort_completion_matches;
+#endif
+
bool editing = 1;
static const char *quote_chars = "\t\n !#$&'()*;<=>?@[\\]^`{|}~";