diff options
Diffstat (limited to 'app-shells/bash/files/bash-2.05b-multibyte-locale.patch')
-rw-r--r-- | app-shells/bash/files/bash-2.05b-multibyte-locale.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/app-shells/bash/files/bash-2.05b-multibyte-locale.patch b/app-shells/bash/files/bash-2.05b-multibyte-locale.patch new file mode 100644 index 0000000..e5f2eb4 --- /dev/null +++ b/app-shells/bash/files/bash-2.05b-multibyte-locale.patch @@ -0,0 +1,50 @@ +diff -ru bash-2.05b.orig/lib/readline/display.c bash-2.05b/lib/readline/display.c +--- bash-2.05b.orig/lib/readline/display.c 2002-06-04 23:54:47.000000000 +0900 ++++ bash-2.05b/lib/readline/display.c 2002-12-12 16:31:06.000000000 +0900 +@@ -1129,16 +1129,24 @@ + memset (&ps_new, 0, sizeof(mbstate_t)); + memset (&ps_old, 0, sizeof(mbstate_t)); + +- new_offset = old_offset = 0; +- for (ofd = old, nfd = new; +- (ofd - old < omax) && *ofd && +- _rl_compare_chars(old, old_offset, &ps_old, new, new_offset, &ps_new); ) +- { +- old_offset = _rl_find_next_mbchar (old, old_offset, 1, MB_FIND_ANY); +- new_offset = _rl_find_next_mbchar (new, new_offset, 1, MB_FIND_ANY); +- ofd = old + old_offset; +- nfd = new + new_offset; +- } ++ if(omax == nmax && strncmp(new,old,omax) == 0) ++ { ++ ofd = old + omax; ++ nfd = new + nmax; ++ } ++ else ++ { ++ new_offset = old_offset = 0; ++ for (ofd = old, nfd = new; ++ (ofd - old < omax) && *ofd && ++ _rl_compare_chars(old, old_offset, &ps_old, new, new_offset, &ps_new); ) ++ { ++ old_offset = _rl_find_next_mbchar (old, old_offset, 1, MB_FIND_ANY); ++ new_offset = _rl_find_next_mbchar (new, new_offset, 1, MB_FIND_ANY); ++ ofd = old + old_offset; ++ nfd = new + new_offset; ++ } ++ } + } + else + #endif +@@ -1169,8 +1177,9 @@ + memset (&ps_old, 0, sizeof (mbstate_t)); + memset (&ps_new, 0, sizeof (mbstate_t)); + +- _rl_adjust_point (old, ols - old, &ps_old); +- _rl_adjust_point (new, nls - new, &ps_new); ++ /* these doesn't make sense */ ++ /* _rl_adjust_point (old, ols - old, &ps_old); */ ++ /* _rl_adjust_point (new, nls - new, &ps_new); */ + + if (_rl_compare_chars (old, ols - old, &ps_old, new, nls - new, &ps_new) == 0) + break; |