NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/56695: libedit does not declare hook functions correctly



>Number:         56695
>Category:       lib
>Synopsis:       libedit does not declare hook functions correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 06 02:30:00 +0000 2022
>Originator:     Walter Lozano
>Release:        
>Organization:
Collabora
>Environment:
>Description:
Library GNU readline uses rl_hook_func_t for hook functions such as
rl_startup_hook and rl_pre_input_hook, unfortunately libedit does not declare them correctly.
>How-To-Repeat:

>Fix:
A proposed fix is

cvs diff: Diffing .
Index: readline.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/readline.c,v
retrieving revision 1.171
diff -u -r1.171 readline.c
--- readline.c	31 Jan 2022 14:44:49 -0000	1.171
+++ readline.c	6 Feb 2022 02:26:07 -0000
@@ -113,8 +113,8 @@
 rl_compentry_func_t *rl_completion_entry_function = NULL;
 char *(*rl_completion_word_break_hook)(void) = NULL;
 rl_completion_func_t *rl_attempted_completion_function = NULL;
-Function *rl_pre_input_hook = NULL;
-Function *rl_startup1_hook = NULL;
+rl_hook_func_t *rl_pre_input_hook = NULL;
+rl_hook_func_t *rl_startup1_hook = NULL;
 int (*rl_getc_function)(FILE *) = NULL;
 char *rl_terminal_name = NULL;
 int rl_already_prompted = 0;
@@ -123,7 +123,7 @@
 int readline_echoing_p = 1;
 int _rl_print_completions_horizontally = 0;
 VFunction *rl_redisplay_function = NULL;
-Function *rl_startup_hook = NULL;
+rl_hook_func_t *rl_startup_hook = NULL;
 VFunction *rl_completion_display_matches_hook = NULL;
 VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal;
 VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal;
@@ -445,7 +445,7 @@
 	if (e == NULL || h == NULL)
 		rl_initialize();
 	if (rl_startup_hook) {
-		(*rl_startup_hook)(NULL, 0);
+		(*rl_startup_hook)();
 	}
 	tty_init(e);
 
@@ -460,7 +460,7 @@
 		goto out;
 
 	if (rl_pre_input_hook)
-		(*rl_pre_input_hook)(NULL, 0);
+		(*rl_pre_input_hook)();
 
 	if (rl_event_hook && !(e->el_flags & NO_TTY)) {
 		el_set(e, EL_GETCFN, _rl_event_read_char);
cvs diff: Diffing TEST
cvs diff: Diffing readline
Index: readline/readline.h
===================================================================
RCS file: /cvsroot/src/lib/libedit/readline/readline.h,v
retrieving revision 1.51
diff -u -r1.51 readline.h
--- readline/readline.h	31 Jan 2022 14:44:49 -0000	1.51
+++ readline/readline.h	6 Feb 2022 02:26:07 -0000
@@ -127,8 +127,8 @@
 extern const char	*rl_special_prefixes;
 extern int		rl_completion_append_character;
 extern int		rl_inhibit_completion;
-extern Function		*rl_pre_input_hook;
-extern Function		*rl_startup_hook;
+extern rl_hook_func_t		*rl_pre_input_hook;
+extern rl_hook_func_t		*rl_startup_hook;
 extern char		*rl_terminal_name;
 extern int		rl_already_prompted;
 extern char		*rl_prompt;



Home | Main Index | Thread Index | Old Index