From 4b70436fd4b5d1059636b34844a5c3737af628b2 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Fri, 6 Aug 2004 20:01:45 +0000 Subject: [PATCH] patch for readline 5.0 [Howard B. Golden] --- ginsh/ginsh_parser.yy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index 447d7086..a93808e8 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -50,6 +50,12 @@ static char *orig_basic_word_break_characters; static const char *orig_basic_word_break_characters; #endif +#if (GINAC_RL_VERSION_MAJOR >= 5) +#define GINAC_RL_COMPLETER_CAST(a) const_cast((a)) +#else +#define GINAC_RL_COMPLETER_CAST(a) (a) +#endif + // Expression stack for %, %% and %%% static void push(const ex &e); static ex exstack[3]; @@ -817,7 +823,7 @@ static char **fcn_completion(const char *text, int start, int end) // For shell commands, revert back to filename completion rl_completion_append_character = orig_completion_append_character; rl_basic_word_break_characters = orig_basic_word_break_characters; - rl_completer_word_break_characters = rl_basic_word_break_characters; + rl_completer_word_break_characters = GINAC_RL_COMPLETER_CAST(rl_basic_word_break_characters); #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) return completion_matches(const_cast(text), (CPFunction *)filename_completion_function); #else @@ -827,7 +833,7 @@ static char **fcn_completion(const char *text, int start, int end) // Otherwise, complete function names rl_completion_append_character = '('; rl_basic_word_break_characters = " \t\n\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"; - rl_completer_word_break_characters = rl_basic_word_break_characters; + rl_completer_word_break_characters = GINAC_RL_COMPLETER_CAST(rl_basic_word_break_characters); #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) return completion_matches(const_cast(text), (CPFunction *)fcn_generator); #else -- 2.44.0