commit f83007fea75c9b70a2a08bfa22a88fd5b50fed67 parent 607ea6e5e7b86c57a2f50b21b5f86418b3d40ec8 Author: hhvn <dev@hhvn.uk> Date: Fri, 22 May 2026 21:25:44 +0100 Prevent use of non-available readline functions Diffstat:
| M | edit-readline.c | | | 29 | +++++++++++++++++++++++++++++ |
1 file changed, 29 insertions(+), 0 deletions(-)
diff --git 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 !#$&'()*;<=>?@[\\]^`{|}~";