]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/readline/readline52-004
readline-compat: update to 6.3
[ipfire-2.x.git] / src / patches / readline / readline52-004
CommitLineData
f19b3cb6
MT
1 READLINE PATCH REPORT
2 =====================
3
4Readline-Release: 5.2
5Patch-ID: readline52-004
6
7Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
8Bug-Reference-ID: <1173636022.7039.36.camel@localhost>
9Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html
10
11Bug-Description:
12
13When restoring the original prompt after finishing an incremental search,
14bash sometimes places the cursor incorrectly if the primary prompt contains
15invisible characters.
16
17Patch:
18
19*** ../readline-5.2.3/display.c Fri Apr 20 13:30:16 2007
20--- display.c Fri Apr 20 15:17:01 2007
21***************
22*** 1599,1604 ****
23 if (temp > 0)
24 {
25 _rl_output_some_chars (nfd, temp);
26! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
27 }
28 }
29--- 1599,1618 ----
30 if (temp > 0)
31 {
32+ /* If nfd begins at the prompt, or before the invisible
33+ characters in the prompt, we need to adjust _rl_last_c_pos
34+ in a multibyte locale to account for the wrap offset and
35+ set cpos_adjusted accordingly. */
36 _rl_output_some_chars (nfd, temp);
37! if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
38! {
39! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
40! if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
41! {
42! _rl_last_c_pos -= wrap_offset;
43! cpos_adjusted = 1;
44! }
45! }
46! else
47! _rl_last_c_pos += temp;
48 }
49 }
50***************
51*** 1608,1613 ****
52--- 1622,1639 ----
53 if (temp > 0)
54 {
55+ /* If nfd begins at the prompt, or before the invisible
56+ characters in the prompt, we need to adjust _rl_last_c_pos
57+ in a multibyte locale to account for the wrap offset and
58+ set cpos_adjusted accordingly. */
59 _rl_output_some_chars (nfd, temp);
60 _rl_last_c_pos += col_temp; /* XXX */
61+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
62+ {
63+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
64+ {
65+ _rl_last_c_pos -= wrap_offset;
66+ cpos_adjusted = 1;
67+ }
68+ }
69 }
70 lendiff = (oe - old) - (ne - new);