summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2024-01-14 15:22:07 -0500
committerChet Ramey <chet.ramey@case.edu>2024-01-14 15:22:07 -0500
commit5d4d92f221d6aac4be445bdd8cd9b48d9ac33f04 (patch)
tree40e156685c303432cf4f0da44e93ed40b9ac3d3d
parent3853739c28a9777d30ff65e8448e8f1a2898f3f2 (diff)
Readline-8.2 patch 10: fix issue where comparing quoted and unquoted words to be completed results in readline not displaying possible matches
-rw-r--r--complete.c18
-rw-r--r--patchlevel2
2 files changed, 18 insertions, 2 deletions
diff --git a/complete.c b/complete.c
index c9e0098..70a0a60 100644
--- a/complete.c
+++ b/complete.c
@@ -2031,9 +2031,25 @@ rl_complete_internal (int what_to_do)
text = rl_copy_text (start, end);
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
+ /* If TEXT contains quote characters, it will be dequoted as part of
+ generating the matches, and the matches will not contain any quote
+ characters. We need to dequote TEXT before performing the comparison.
+ Since compare_match performs the dequoting, and we only want to do it
+ once, we don't call compare_matches after dequoting TEXT; we call
+ strcmp directly. */
/* nontrivial_lcd is set if the common prefix adds something to the word
being completed. */
- nontrivial_lcd = matches && compare_match (text, matches[0]) != 0;
+ if (rl_filename_completion_desired && rl_filename_quoting_desired &&
+ rl_completion_found_quote && rl_filename_dequoting_function)
+ {
+ char *t;
+ t = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
+ xfree (text);
+ text = t;
+ nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
+ }
+ else
+ nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
if (what_to_do == '!' || what_to_do == '@')
tlen = strlen (text);
xfree (text);
diff --git a/patchlevel b/patchlevel
index c0ac809..810c277 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-9
+10