]>
Commit | Line | Data |
---|---|---|
e9ba050b AB |
1 | READLINE PATCH REPORT |
2 | ===================== | |
3 | ||
4 | Readline-Release: 8.2 | |
5 | Patch-ID: readline82-010 | |
6 | ||
7 | Bug-Reported-by: Martin Castillo <castilma@uni-bremen.de> | |
8 | Bug-Reference-ID: <2d42153b-cf65-caba-dff1-cd3bc6268c7e@uni-bremen.de> | |
9 | Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2023-01/msg00000.html | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | Fix the case where text to be completed from the line buffer (quoted) is | |
14 | compared to the common prefix of the possible matches (unquoted) and the | |
15 | quoting makes the former appear to be longer than the latter. Readline | |
16 | assumes the match doesn't add any characters to the word and doesn't display | |
17 | multiple matches. | |
18 | ||
19 | Patch (apply with `patch -p0'): | |
20 | ||
21 | *** ../readline-8.2-patched/complete.c Tue Apr 5 10:47:06 2022 | |
22 | --- complete.c Sat Jan 7 14:19:45 2023 | |
23 | *************** | |
24 | *** 2032,2038 **** | |
25 | text = rl_copy_text (start, end); | |
26 | matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char); | |
27 | /* nontrivial_lcd is set if the common prefix adds something to the word | |
28 | being completed. */ | |
29 | ! nontrivial_lcd = matches && compare_match (text, matches[0]) != 0; | |
30 | if (what_to_do == '!' || what_to_do == '@') | |
31 | tlen = strlen (text); | |
32 | --- 2038,2060 ---- | |
33 | text = rl_copy_text (start, end); | |
34 | matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char); | |
35 | + /* If TEXT contains quote characters, it will be dequoted as part of | |
36 | + generating the matches, and the matches will not contain any quote | |
37 | + characters. We need to dequote TEXT before performing the comparison. | |
38 | + Since compare_match performs the dequoting, and we only want to do it | |
39 | + once, we don't call compare_matches after dequoting TEXT; we call | |
40 | + strcmp directly. */ | |
41 | /* nontrivial_lcd is set if the common prefix adds something to the word | |
42 | being completed. */ | |
43 | ! if (rl_filename_completion_desired && rl_filename_quoting_desired && | |
44 | ! rl_completion_found_quote && rl_filename_dequoting_function) | |
45 | ! { | |
46 | ! char *t; | |
47 | ! t = (*rl_filename_dequoting_function) (text, rl_completion_quote_character); | |
48 | ! xfree (text); | |
49 | ! text = t; | |
50 | ! nontrivial_lcd = matches && strcmp (text, matches[0]) != 0; | |
51 | ! } | |
52 | ! else | |
53 | ! nontrivial_lcd = matches && strcmp (text, matches[0]) != 0; | |
54 | if (what_to_do == '!' || what_to_do == '@') | |
55 | tlen = strlen (text); | |
56 | ||
57 | *** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500 | |
58 | --- patchlevel 2014-03-21 08:28:40.000000000 -0400 | |
59 | *************** | |
60 | *** 1,3 **** | |
61 | # Do not edit -- exists only for use by patch | |
62 | ||
63 | ! 9 | |
64 | --- 1,3 ---- | |
65 | # Do not edit -- exists only for use by patch | |
66 | ||
67 | ! 10 |