7 Bug-Reported-by: clowenst@ucsd.edu
8 Bug-Reference-ID: <156388ec.0212021151.51a48df1@posting.google.com>
13 When running in a locale with multibyte characters, the readline display
14 updater will use carriage returns when drawing the line, overwriting any
15 partial output already on the screen and not terminated by a newline.
19 *** ../bash-2.05b/lib/readline/display.c Tue Jun 4 10:54:47 2002
20 --- lib/readline/display.c Fri Sep 13 16:22:57 2002
24 #if defined (HANDLE_MULTIBYTE)
25 ! static int _rl_col_width PARAMS((char *, int, int));
26 static int *_rl_wrapped_line;
30 #if defined (HANDLE_MULTIBYTE)
31 ! static int _rl_col_width PARAMS((const char *, int, int));
32 static int *_rl_wrapped_line;
36 _rl_output_some_chars (nfd + lendiff, temp - lendiff);
38 - _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff;
40 _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
44 _rl_output_some_chars (nfd + lendiff, temp - lendiff);
46 _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
48 + _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
53 /* If we have multibyte characters, NEW is indexed by the buffer point in
54 a multibyte string, but _rl_last_c_pos is the display position. In
55 ! this case, NEW's display position is not obvious. */
56 ! if ((MB_CUR_MAX == 1 || rl_byte_oriented ) && _rl_last_c_pos == new) return;
58 if (_rl_last_c_pos == new) return;
60 /* If we have multibyte characters, NEW is indexed by the buffer point in
61 a multibyte string, but _rl_last_c_pos is the display position. In
62 ! this case, NEW's display position is not obvious and must be
64 ! if (MB_CUR_MAX == 1 || rl_byte_oriented)
66 ! if (_rl_last_c_pos == new)
69 ! else if (_rl_last_c_pos == _rl_col_width (data, 0, new))
72 if (_rl_last_c_pos == new) return;
76 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
78 ! tputs (_rl_term_cr, 1, _rl_output_character_function);
79 ! for (i = 0; i < new; i++)
80 ! putc (data[i], rl_outstream);
83 _rl_backspace (_rl_last_c_pos - new);
86 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
87 ! _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new));
89 _rl_backspace (_rl_last_c_pos - new);
93 _rl_col_width (str, start, end)
99 _rl_col_width (str, start, end)
106 #endif /* HANDLE_MULTIBYTE */