summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/bash/files/bash-3.0-utf8.patch')
-rw-r--r--app-shells/bash/files/bash-3.0-utf8.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/app-shells/bash/files/bash-3.0-utf8.patch b/app-shells/bash/files/bash-3.0-utf8.patch
new file mode 100644
index 0000000..8f10db9
--- /dev/null
+++ b/app-shells/bash/files/bash-3.0-utf8.patch
@@ -0,0 +1,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)