Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit - fix types of rl_completion_entry_function and ...



details:   https://anonhg.NetBSD.org/src/rev/9ad28c865a84
branches:  trunk
changeset: 338472:9ad28c865a84
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 26 19:59:21 2015 +0000

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

diffstat:

 lib/libedit/readline.c          |  14 ++++++++------
 lib/libedit/readline/readline.h |   6 +++---
 2 files changed, 11 insertions(+), 9 deletions(-)

diffs (90 lines):

diff -r d9c9332f6369 -r 9ad28c865a84 lib/libedit/readline.c
--- a/lib/libedit/readline.c    Tue May 26 16:48:05 2015 +0000
+++ b/lib/libedit/readline.c    Tue May 26 19:59:21 2015 +0000
@@ -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 @@
 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 @@
 
 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 @@
        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_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 @@
 }
 
 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)
diff -r d9c9332f6369 -r 9ad28c865a84 lib/libedit/readline/readline.h
--- a/lib/libedit/readline/readline.h   Tue May 26 16:48:05 2015 +0000
+++ b/lib/libedit/readline/readline.h   Tue May 26 19:59:21 2015 +0000
@@ -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 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_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);



Home | Main Index | Thread Index | Old Index