NetBSD Problem Report #56695

From www@netbsd.org  Sun Feb  6 02:29:00 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9ECD51A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  6 Feb 2022 02:29:00 +0000 (UTC)
Message-Id: <20220206022858.F3BC51A923B@mollari.NetBSD.org>
Date: Sun,  6 Feb 2022 02:28:58 +0000 (UTC)
From: walter.lozano@collabora.com
Reply-To: walter.lozano@collabora.com
To: gnats-bugs@NetBSD.org
Subject: libedit does not declare hook functions correctly
X-Send-Pr-Version: www-1.0

>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
>Last-Modified:  Sat Feb 19 17:50:01 +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;

>Audit-Trail:
From: Walter Lozano <walter.lozano@collabora.com>
To: gnats-bugs@netbsd.org,
 "lib-bug-people@netbsd.org" <lib-bug-people@netbsd.org>,
 "gnats-admin@netbsd.org" <gnats-admin@netbsd.org>,
 "netbsd-bugs@netbsd.org" <netbsd-bugs@netbsd.org>
Cc: 
Subject: Re: lib/56695: libedit does not declare hook functions correctly
Date: Fri, 18 Feb 2022 00:27:42 -0300

 Hi all,

 On 2/5/22 23:30, gnats-admin@netbsd.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `lib/56695'.
 > The individual assigned to look at your
 > report is: lib-bug-people.
 > 
 >> Category:       lib
 >> Responsible:    lib-bug-people
 >> Synopsis:       libedit does not declare hook functions correctly
 >> Arrival-Date:   Sun Feb 06 02:30:00 +0000 2022
 > 

 Since usually other libedit patches I sent were reviewed and merged very 
 quickly I was curious about this one.

 Is there anything I can to do to help to move forward it?

 Thanks in advance!

 -- 
 Walter Lozano
 Collabora Ltd.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56695 CVS commit: src/lib/libedit
Date: Sat, 19 Feb 2022 12:45:02 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sat Feb 19 17:45:02 UTC 2022

 Modified Files:
 	src/lib/libedit: readline.c
 	src/lib/libedit/readline: readline.h

 Log Message:
 PR/56695: Walter Lozano: Correct declaration of hook functions.


 To generate a diff of this commit:
 cvs rdiff -u -r1.172 -r1.173 src/lib/libedit/readline.c
 cvs rdiff -u -r1.52 -r1.53 src/lib/libedit/readline/readline.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.