summaryrefslogtreecommitdiff
blob: 8f10db92d5e816510a1e0740d99d59daed0b46b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Hack around this bug:

http://lists.gnu.org/archive/html/bug-bash/2004-10/msg00419.html

not suitable for upstream; need a proper fix

http://bugs.gentoo.org/108936
http://bugs.gentoo.org/69407

--- bash-3.0/lib/readline/display.c
+++ bash-3.0/lib/readline/display.c
@@ -1414,7 +1414,7 @@
 	      insert_some_chars (nfd, lendiff, col_lendiff);
 	      _rl_last_c_pos += col_lendiff;
 	    }
-	  else if (*ols == 0 && lendiff > 0)
+	  else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && col_lendiff > 0)
 	    {
 	      /* At the end of a line the characters do not have to
 		 be "inserted".  They can just be placed on the screen. */
--- bash-3.0/lib/readline/histexpand.c
+++ bash-3.0/lib/readline/histexpand.c
@@ -206,6 +206,7 @@
 
   /* Only a closing `?' or a newline delimit a substring search string. */
   for (local_index = i; c = string[i]; i++)
+  {
 #if defined (HANDLE_MULTIBYTE)
     if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
       {
@@ -222,7 +223,6 @@
 	    continue;
 	  }
       }
-    else
 #endif /* HANDLE_MULTIBYTE */
       if ((!substring_okay && (whitespace (c) || c == ':' ||
 	  (history_search_delimiter_chars && member (c, history_search_delimiter_chars)) ||
@@ -230,7 +230,7 @@
 	  string[i] == '\n' ||
 	  (substring_okay && string[i] == '?'))
 	break;
-
+  }
   which = i - local_index;
   temp = (char *)xmalloc (1 + which);
   if (which)