aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2000-04-12 16:43:27 +0000
committerEli Zaretskii <eliz@gnu.org>2000-04-12 16:43:27 +0000
commitae678129ebe35afec00cb998a01fc91f2fc03334 (patch)
treebfa9f9aac587519450d7bbca1c9215e766eba5f8 /gdb/top.c
parentf0ca3dcec2ab02f45a6c049ad7d84ae2fd1bb3bb (diff)
downloadgdb-ae678129ebe35afec00cb998a01fc91f2fc03334.zip
gdb-ae678129ebe35afec00cb998a01fc91f2fc03334.tar.gz
gdb-ae678129ebe35afec00cb998a01fc91f2fc03334.tar.bz2
* 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.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c12
1 files changed, 12 insertions, 0 deletions
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;
}
}
}