Module Name: src
Committed By: christos
Date: Tue May 15 17:30:04 UTC 2012
Modified Files:
src/lib/libedit: readline.c
src/lib/libedit/readline: readline.h
Log Message:
Add rl_completion_word_break_hook from:
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/\
5ec6a45fa762b8cbd0305ca06acb8780335a486a
To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/lib/libedit/readline.c
cvs rdiff -u -r1.32 -r1.33 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.101 src/lib/libedit/readline.c:1.102
--- src/lib/libedit/readline.c:1.101 Wed Mar 21 01:33:26 2012
+++ src/lib/libedit/readline.c Tue May 15 13:30:04 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.101 2012/03/21 05:33:26 matt Exp $ */
+/* $NetBSD: readline.c,v 1.102 2012/05/15 17:30:04 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.101 2012/03/21 05:33:26 matt Exp $");
+__RCSID("$NetBSD: readline.c,v 1.102 2012/05/15 17:30:04 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -1756,6 +1756,7 @@ rl_complete(int ignore __attribute__((__
#ifdef WIDECHAR
static ct_buffer_t wbreak_conv, sprefix_conv;
#endif
+ char *breakchars;
if (h == NULL || e == NULL)
rl_initialize();
@@ -1768,12 +1769,17 @@ rl_complete(int ignore __attribute__((__
return CC_REFRESH;
}
+ if (rl_completion_word_break_hook != NULL)
+ breakchars = (*rl_completion_word_break_hook)();
+ else
+ breakchars = rl_basic_word_break_characters;
+
/* Just look at how many global variables modify this operation! */
return fn_complete(e,
(CPFunction *)rl_completion_entry_function,
rl_attempted_completion_function,
ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
- ct_decode_string(rl_special_prefixes, &sprefix_conv),
+ ct_decode_string(breakchars, &sprefix_conv),
_rl_completion_append_character_function,
(size_t)rl_completion_query_items,
&rl_completion_type, &rl_attempted_completion_over,
Index: src/lib/libedit/readline/readline.h
diff -u src/lib/libedit/readline/readline.h:1.32 src/lib/libedit/readline/readline.h:1.33
--- src/lib/libedit/readline/readline.h:1.32 Thu Sep 16 16:08:52 2010
+++ src/lib/libedit/readline/readline.h Tue May 15 13:30:04 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.32 2010/09/16 20:08:52 christos Exp $ */
+/* $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -109,6 +109,7 @@ extern char *rl_basic_word_break_charac
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function;
+extern char *(*rl_completion_word_break_hook)(void);
extern CPPFunction *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type;