From: Eli Zaretskii Date: Wed, 12 Apr 2000 16:43:27 +0000 (+0000) Subject: * top.c (gdb_completer_file_name_break_characters): New variable. X-Git-Tag: readline-pre-41-import~796 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae678129ebe35afec00cb998a01fc91f2fc03334;p=platform%2Fupstream%2Fbinutils.git * top.c (gdb_completer_file_name_break_characters): New variable. (line_completion_function): When completing on file names, use gdb_completer_file_name_break_characters as word break characters for the readline library. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8a4824d..ed5d619 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2000-04-12 Eli Zaretskii + + * top.c (gdb_completer_file_name_break_characters): New variable. + (line_completion_function): When completing on file names, use + gdb_completer_file_name_break_characters as word break + characters for the readline library. + 2000-04-12 Mark Kettenis * i387-tdep.c (print_i387_value): Avoid call to diff --git a/gdb/top.c b/gdb/top.c index 7c99649..0959d41 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1833,6 +1833,12 @@ char *gdb_completer_word_break_characters = char *gdb_completer_command_word_break_characters = " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,"; +/* When completing on file names, we remove from the list of word + break characters any characters that are commonly used in file + names, such as '-', '+', '~', etc. Otherwise, readline displays + incorrect completion candidates. */ +char *gdb_completer_file_name_break_characters = " \t\n*|\"';:?/><"; + /* Characters that can be used to quote completion strings. Note that we can't include '"' because the gdb C parser treats such quoted sequences as strings. */ @@ -2122,6 +2128,9 @@ line_completion_function (text, matches, line_buffer, point) /* It is a normal command; what comes after it is completed by the command's completer function. */ list = (*c->completer) (p, word); + if (c->completer == filename_completer) + rl_completer_word_break_characters = + gdb_completer_file_name_break_characters; } } else @@ -2168,6 +2177,9 @@ line_completion_function (text, matches, line_buffer, point) { /* It is a normal command. */ list = (*c->completer) (p, word); + if (c->completer == filename_completer) + rl_completer_word_break_characters = + gdb_completer_file_name_break_characters; } } }