From 5f2281cb2d5298c2a4b0bf5868c2e4144902a395 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Jan 03 2008 17:17:31 +0000 Subject: - include upstream patches 008-011 --- diff --git a/readline-5.2-008.patch b/readline-5.2-008.patch new file mode 100644 index 0000000..1d7f327 --- /dev/null +++ b/readline-5.2-008.patch @@ -0,0 +1,70 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 5.2 +Patch-ID: readline52-008 + +Bug-Reported-by: dAniel hAhler +Bug-Reference-ID: <4702ED8A.5000503@thequod.de> +Bug-Reference-URL: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/119938 + +Bug-Description: + +When updating the display after displaying, for instance, a list of possible +completions, readline will place the cursor at the wrong position if the +prompt contains invisible characters and a newline. + +Patch: + +*** ../readline-5.2-patched/display.c Mon Aug 6 14:26:29 2007 +--- display.c Wed Oct 10 22:43:58 2007 +*************** +*** 1049,1053 **** + else + tx = nleft; +! if (_rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ +--- 1049,1053 ---- + else + tx = nleft; +! if (tx >= 0 && _rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ +*************** +*** 1205,1209 **** + { + register char *ofd, *ols, *oe, *nfd, *nls, *ne; +! int temp, lendiff, wsatend, od, nd; + int current_invis_chars; + int col_lendiff, col_temp; +--- 1205,1209 ---- + { + register char *ofd, *ols, *oe, *nfd, *nls, *ne; +! int temp, lendiff, wsatend, od, nd, o_cpos; + int current_invis_chars; + int col_lendiff, col_temp; +*************** +*** 1466,1469 **** +--- 1466,1471 ---- + } + ++ o_cpos = _rl_last_c_pos; ++ + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor postion in multibyte mode, but a buffer index when not in a +*************** +*** 1475,1479 **** + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ +! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; + #endif +--- 1477,1483 ---- + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ +! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && +! (_rl_last_c_pos > 0 || o_cpos > 0) && +! _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; + #endif diff --git a/readline-5.2-009.patch b/readline-5.2-009.patch new file mode 100644 index 0000000..af9e381 --- /dev/null +++ b/readline-5.2-009.patch @@ -0,0 +1,45 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 5.2 +Patch-ID: readline52-009 + +Bug-Reported-by: dAniel hAhler +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +Under some circumstances, readline will incorrectly display a prompt string +containing invisible characters after the final newline. + +Patch: + +*** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400 +--- display.c 2007-11-10 17:51:29.000000000 -0500 +*************** +*** 392,396 **** + local_prompt = expand_prompt (p, &prompt_visible_length, + &prompt_last_invisible, +! (int *)NULL, + &prompt_physical_chars); + c = *t; *t = '\0'; +--- 420,424 ---- + local_prompt = expand_prompt (p, &prompt_visible_length, + &prompt_last_invisible, +! &prompt_invis_chars_first_line, + &prompt_physical_chars); + c = *t; *t = '\0'; +*************** +*** 399,403 **** + local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, + (int *)NULL, +! &prompt_invis_chars_first_line, + (int *)NULL); + *t = c; +--- 427,431 ---- + local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, + (int *)NULL, +! (int *)NULL, + (int *)NULL); + *t = c; diff --git a/readline-5.2-010.patch b/readline-5.2-010.patch new file mode 100644 index 0000000..ee5c026 --- /dev/null +++ b/readline-5.2-010.patch @@ -0,0 +1,47 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 5.2 +Patch-ID: readline52-010 + +Bug-Reported-by: Miroslav Lichvar +Bug-Reference-ID: Fri, 02 Nov 2007 14:07:45 +0100 +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-11/msg00000.html + +Bug-Description: + +In certain cases when outputting characters at the end of the line, +e.g., when displaying the prompt string, readline positions the cursor +incorrectly if the prompt string contains invisible characters and the +text being drawn begins before the last invisible character in the line. + +Patch: + +*** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400 +--- display.c 2007-11-10 17:51:29.000000000 -0500 +*************** +*** 1566,1574 **** + else + { +- /* We have horizontal scrolling and we are not inserting at +- the end. We have invisible characters in this line. This +- is a dumb update. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + return; + } +--- 1619,1632 ---- + else + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; ++ /* If nfd begins before any invisible characters in the prompt, ++ adjust _rl_last_c_pos to account for wrap_offset and set ++ cpos_adjusted to let the caller know. */ ++ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible)) ++ { ++ _rl_last_c_pos -= wrap_offset; ++ cpos_adjusted = 1; ++ } + return; + } diff --git a/readline-5.2-011.patch b/readline-5.2-011.patch new file mode 100644 index 0000000..a1197ed --- /dev/null +++ b/readline-5.2-011.patch @@ -0,0 +1,32 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 5.2 +Patch-ID: readline52-011 + +Bug-Reported-by: Uwe Doering +Bug-Reference-ID: <46F3DD72.2090801@geminix.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-09/msg00102.html + +Bug-Description: + +There is an off-by-one error in the code that buffers characters received +very quickly in succession, causing characters to be dropped. + +Patch: + +*** ../readline-5.2-patched/input.c 2007-08-25 13:47:10.000000000 -0400 +--- input.c 2007-10-12 22:55:25.000000000 -0400 +*************** +*** 155,159 **** + pop_index--; + if (pop_index < 0) +! pop_index = ibuffer_len - 1; + ibuffer[pop_index] = key; + return (1); +--- 155,159 ---- + pop_index--; + if (pop_index < 0) +! pop_index = ibuffer_len; + ibuffer[pop_index] = key; + return (1); diff --git a/readline-5.2-inv.patch b/readline-5.2-inv.patch deleted file mode 100644 index f7c8c10..0000000 --- a/readline-5.2-inv.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up readline-5.2/display.c.inv readline-5.2/display.c ---- readline-5.2/display.c.inv 2007-10-31 17:14:31.000000000 +0100 -+++ readline-5.2/display.c 2007-10-31 17:15:00.000000000 +0100 -@@ -943,7 +943,7 @@ rl_redisplay () - cpos_adjusted == 0 && - _rl_last_c_pos != o_cpos && - _rl_last_c_pos > wrap_offset && -- o_cpos < prompt_last_invisible) -+ o_cpos <= prompt_last_invisible) - _rl_last_c_pos -= wrap_offset; - - /* If this is the line with the prompt, we might need to diff --git a/readline.spec b/readline.spec index 9841b33..f22eba4 100644 --- a/readline.spec +++ b/readline.spec @@ -1,7 +1,7 @@ Summary: A library for editing typed command lines Name: readline Version: 5.2 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html @@ -14,7 +14,10 @@ Patch5: readline-5.2-004.patch Patch6: readline-5.2-005.patch Patch7: readline-5.2-006.patch Patch8: readline-5.2-007.patch -Patch9: readline-5.2-inv.patch +Patch9: readline-5.2-008.patch +Patch10: readline-5.2-009.patch +Patch11: readline-5.2-010.patch +Patch12: readline-5.2-011.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info BuildRequires: ncurses-devel @@ -61,7 +64,10 @@ library. %patch6 -p0 -b .005 %patch7 -p0 -b .006 %patch8 -p0 -b .007 -%patch9 -p1 -b .inv +%patch9 -p0 -b .008 +%patch10 -p0 -b .009 +%patch11 -p0 -b .010 +%patch12 -p0 -b .011 pushd examples rm -f rlfe/configure @@ -130,6 +136,9 @@ fi %{_libdir}/lib*.a %changelog +* Thu Jan 03 2008 Miroslav Lichvar 5.2-9 +- include upstream patches 008-011 + * Mon Nov 05 2007 Miroslav Lichvar 5.2-8 - fix cursor position when prompt has one invisible character (#358231) - merge review fixes (#226361)