Module Name:    src
Committed By:   christos
Date:           Tue May 26 19:59:21 UTC 2015

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

Log Message:
- fix types of rl_completion_entry_function and rl_add_defun
- call update pos before completion to refresh the screen
>From Thomas Eriksson


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/lib/libedit/readline.c
cvs rdiff -u -r1.34 -r1.35 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.

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.115 src/lib/libedit/readline.c:1.116
--- src/lib/libedit/readline.c:1.115	Wed Apr  1 11:23:15 2015
+++ src/lib/libedit/readline.c	Tue May 26 15:59:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.116 2015/05/26 19:59:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.115 2015/04/01 15:23:15 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.116 2015/05/26 19:59:21 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -107,7 +107,7 @@ int rl_attempted_completion_over = 0;
 char *rl_basic_word_break_characters = break_chars;
 char *rl_completer_word_break_characters = NULL;
 char *rl_completer_quote_characters = NULL;
-Function *rl_completion_entry_function = NULL;
+CPFunction *rl_completion_entry_function = NULL;
 char *(*rl_completion_word_break_hook)(void) = NULL;
 CPPFunction *rl_attempted_completion_function = NULL;
 Function *rl_pre_input_hook = NULL;
@@ -160,7 +160,7 @@ int rl_completion_append_character = ' '
 
 static History *h = NULL;
 static EditLine *e = NULL;
-static Function *map[256];
+static rl_command_func_t *map[256];
 static jmp_buf topbuf;
 
 /* internal functions */
@@ -1827,6 +1827,8 @@ rl_complete(int ignore __attribute__((__
 	else
 		breakchars = rl_basic_word_break_characters;
 
+	_rl_update_pos();
+
 	/* Just look at how many global variables modify this operation! */
 	return fn_complete(e,
 	    (CPFunction *)rl_completion_entry_function,
@@ -1958,7 +1960,7 @@ rl_bind_wrapper(EditLine *el __attribute
 
 	_rl_update_pos();
 
-	(*map[c])(NULL, c);
+	(*map[c])(1, c);
 
 	/* If rl_done was set by the above call, deal with it here */
 	if (rl_done)
@@ -1968,7 +1970,7 @@ rl_bind_wrapper(EditLine *el __attribute
 }
 
 int
-rl_add_defun(const char *name, Function *fun, int c)
+rl_add_defun(const char *name, rl_command_func_t *fun, int c)
 {
 	char dest[8];
 	if ((size_t)c >= sizeof(map) / sizeof(map[0]) || c < 0)

Index: src/lib/libedit/readline/readline.h
diff -u src/lib/libedit/readline/readline.h:1.34 src/lib/libedit/readline/readline.h:1.35
--- src/lib/libedit/readline/readline.h:1.34	Mon May 27 20:10:34 2013
+++ src/lib/libedit/readline/readline.h	Tue May 26 15:59:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.h,v 1.34 2013/05/28 00:10:34 christos Exp $	*/
+/*	$NetBSD: readline.h,v 1.35 2015/05/26 19:59:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ extern int		 max_input_history;
 extern char		*rl_basic_word_break_characters;
 extern char		*rl_completer_word_break_characters;
 extern char		*rl_completer_quote_characters;
-extern Function		*rl_completion_entry_function;
+extern CPFunction	*rl_completion_entry_function;
 extern char		*(*rl_completion_word_break_hook)(void);
 extern CPPFunction	*rl_attempted_completion_function;
 extern int		 rl_attempted_completion_over;
@@ -194,7 +194,7 @@ int		 rl_read_init_file(const char *);
 int		 rl_parse_and_bind(const char *);
 int		 rl_variable_bind(const char *, const char *);
 void		 rl_stuff_char(int);
-int		 rl_add_defun(const char *, Function *, int);
+int		 rl_add_defun(const char *, rl_command_func_t *, int);
 HISTORY_STATE	*history_get_history_state(void);
 void		 rl_get_screen_size(int *, int *);
 void		 rl_set_screen_size(int, int);

Reply via email to