5 Patch-ID: readline52-001
7 Bug-Reported-by: ebb9@byu.net
8 Bug-Reference-ID: <45540862.9030900@byu.net>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00017.html
10 http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00016.html
14 In some cases, code that is intended to be used in the presence of multibyte
15 characters is called when no such characters are present, leading to incorrect
16 display position calculations and incorrect redisplay.
20 *** ../readline-5.2/display.c Thu Sep 14 14:20:12 2006
21 --- display.c Mon Nov 13 17:55:57 2006
27 + if (MB_CUR_MAX == 1 || rl_byte_oriented)
28 + return (end - start);
30 memset (&ps, 0, sizeof (mbstate_t));
36 Patch-ID: readline52-002
38 Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
39 Bug-Reference-ID: <45BDC44D.80609@mysql.com>
40 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
44 Readline neglects to reallocate the array it uses to keep track of wrapped
45 screen lines when increasing its size. This will eventually result in
46 segmentation faults when given sufficiently long input.
50 *** ../readline-5.2-patched/display.c Thu Sep 14 14:20:12 2006
51 --- display.c Fri Feb 2 20:23:17 2007
55 wrap_offset = prompt_invis_chars_first_line = 0;
58 + #if defined (HANDLE_MULTIBYTE)
59 #define CHECK_INV_LBREAKS() \
61 if (newlines >= (inv_lbsize - 2)) \
64 inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
65 + _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
69 + #define CHECK_INV_LBREAKS() \
71 + if (newlines >= (inv_lbsize - 2)) \
74 + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
77 + #endif /* HANDLE_MULTIBYTE */
79 #if defined (HANDLE_MULTIBYTE)
80 #define CHECK_LPOS() \
86 Patch-ID: readline52-003
88 Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
89 Bug-Reference-ID: <1171795523.8021.18.camel@localhost>
90 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-02/msg00054.html
94 When moving the cursor, bash sometimes misplaces the cursor when the prompt
95 contains two or more multibyte characters. The particular circumstance that
96 uncovered the problem was having the (multibyte) current directory name in
101 *** ../readline-5.2.2/display.c Fri Jan 19 13:34:50 2007
102 --- display.c Sat Mar 10 17:25:44 2007
106 dpos = _rl_col_width (data, 0, new);
107 ! if (dpos > prompt_last_invisible) /* XXX - don't use woff here */
112 dpos = _rl_col_width (data, 0, new);
113 ! /* Use NEW when comparing against the last invisible character in the
114 ! prompt string, since they're both buffer indices and DPOS is a
115 ! desired display position. */
116 ! if (new > prompt_last_invisible) /* XXX - don't use woff here */
120 READLINE PATCH REPORT
121 =====================
123 Readline-Release: 5.2
124 Patch-ID: readline52-004
126 Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
127 Bug-Reference-ID: <1173636022.7039.36.camel@localhost>
128 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html
132 When restoring the original prompt after finishing an incremental search,
133 bash sometimes places the cursor incorrectly if the primary prompt contains
134 invisible characters.
138 *** ../readline-5.2.3/display.c Fri Apr 20 13:30:16 2007
139 --- display.c Fri Apr 20 15:17:01 2007
144 _rl_output_some_chars (nfd, temp);
145 ! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
151 + /* If nfd begins at the prompt, or before the invisible
152 + characters in the prompt, we need to adjust _rl_last_c_pos
153 + in a multibyte locale to account for the wrap offset and
154 + set cpos_adjusted accordingly. */
155 _rl_output_some_chars (nfd, temp);
156 ! if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
158 ! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
159 ! if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
161 ! _rl_last_c_pos -= wrap_offset;
166 ! _rl_last_c_pos += temp;
174 + /* If nfd begins at the prompt, or before the invisible
175 + characters in the prompt, we need to adjust _rl_last_c_pos
176 + in a multibyte locale to account for the wrap offset and
177 + set cpos_adjusted accordingly. */
178 _rl_output_some_chars (nfd, temp);
179 _rl_last_c_pos += col_temp; /* XXX */
180 + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
182 + if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
184 + _rl_last_c_pos -= wrap_offset;
189 lendiff = (oe - old) - (ne - new);
191 READLINE PATCH REPORT
192 =====================
194 Readline-Release: 5.2
195 Patch-ID: readline52-005
197 Bug-Reported-by: Thomas Loeber <ifp@loeber1.de>
198 Bug-Reference-ID: <200703082223.08919.ifp@loeber1.de>
199 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00036.html
203 When rl_read_key returns -1, indicating that readline's controlling terminal
204 has been invalidated for some reason (e.g., receiving a SIGHUP), the error
205 status was not reported correctly to the caller. This could cause input
210 *** ../readline-5.2/complete.c Fri Jul 28 11:35:49 2006
211 --- complete.c Tue Mar 13 08:50:16 2007
214 if (c == 'n' || c == 'N' || c == RUBOUT)
216 ! if (c == ABORT_CHAR)
217 _rl_abort_internal ();
218 if (for_pager && (c == NEWLINE || c == RETURN))
220 if (c == 'n' || c == 'N' || c == RUBOUT)
222 ! if (c == ABORT_CHAR || c < 0)
223 _rl_abort_internal ();
224 if (for_pager && (c == NEWLINE || c == RETURN))
225 *** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
226 --- input.c Wed May 2 16:07:59 2007
232 size_t mbchar_bytes_length;
238 size_t mbchar_bytes_length;
242 memset(&ps, 0, sizeof (mbstate_t));
243 memset(&ps_back, 0, sizeof (mbstate_t));
245 while (mb_len < size)
247 RL_SETSTATE(RL_STATE_MOREINPUT);
248 ! mbchar[mb_len++] = rl_read_key ();
249 RL_UNSETSTATE(RL_STATE_MOREINPUT);
251 mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
252 if (mbchar_bytes_length == (size_t)(-1))
254 memset(&ps, 0, sizeof (mbstate_t));
255 memset(&ps_back, 0, sizeof (mbstate_t));
258 while (mb_len < size)
260 RL_SETSTATE(RL_STATE_MOREINPUT);
261 ! c = rl_read_key ();
262 RL_UNSETSTATE(RL_STATE_MOREINPUT);
267 + mbchar[mb_len++] = c;
269 mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
270 if (mbchar_bytes_length == (size_t)(-1))
274 memset (mb, 0, mlen);
275 ! for (i = 0; i < mlen; i++)
280 memset (mb, 0, mlen);
281 ! for (i = 0; c >= 0 && i < mlen; i++)
284 *** ../readline-5.2/isearch.c Mon Dec 26 17:18:53 2005
285 --- isearch.c Fri Mar 9 14:30:59 2007
289 f = (rl_command_func_t *)NULL;
291 ! /* Translate the keys we do something with to opcodes. */
292 if (c >= 0 && _rl_keymap[c].type == ISFUNC)
296 f = (rl_command_func_t *)NULL;
300 ! cxt->sflags |= SF_FAILED;
301 ! cxt->history_pos = cxt->last_found_line;
305 ! /* Translate the keys we do something with to opcodes. */
306 if (c >= 0 && _rl_keymap[c].type == ISFUNC)
308 *** ../readline-5.2/misc.c Mon Dec 26 17:20:46 2005
309 --- misc.c Fri Mar 9 14:44:11 2007
314 RL_UNSETSTATE(RL_STATE_NUMERICARG);
317 return (_rl_dispatch (key, _rl_keymap));
319 *** ../readline-5.2/readline.c Wed Aug 16 15:00:36 2006
320 --- readline.c Fri Mar 9 14:47:24 2007
325 nkey = _rl_subseq_getchar (cxt->okey);
328 + _rl_abort_internal ();
331 r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
332 cxt->flags |= KSEQ_DISPATCHED;
333 *** ../readline-5.2/text.c Fri Jul 28 11:55:27 2006
334 --- text.c Sun Mar 25 13:41:38 2007
338 RL_UNSETSTATE(RL_STATE_MOREINPUT);
343 #if defined (HANDLE_SIGNALS)
344 if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
348 mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX);
354 return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
358 RL_UNSETSTATE(RL_STATE_MOREINPUT);
364 return (_rl_char_search_internal (-count, bdir, c));
365 *** ../readline-5.2/vi_mode.c Sat Jul 29 16:42:28 2006
366 --- vi_mode.c Fri Mar 9 15:02:11 2007
371 RL_UNSETSTATE(RL_STATE_MOREINPUT);
384 c = rl_read_key (); /* real command */
385 RL_UNSETSTATE(RL_STATE_MOREINPUT);
395 _rl_callback_generic_arg *data;
397 #if defined (HANDLE_MULTIBYTE)
398 ! _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
400 RL_SETSTATE(RL_STATE_MOREINPUT);
401 ! _rl_vi_last_search_char = rl_read_key ();
402 RL_UNSETSTATE(RL_STATE_MOREINPUT);
405 _rl_callback_func = 0;
406 _rl_want_redisplay = 1;
408 _rl_callback_generic_arg *data;
411 #if defined (HANDLE_MULTIBYTE)
412 ! c = _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
414 RL_SETSTATE(RL_STATE_MOREINPUT);
415 ! c = rl_read_key ();
416 RL_UNSETSTATE(RL_STATE_MOREINPUT);
422 + #if !defined (HANDLE_MULTIBYTE)
423 + _rl_vi_last_search_char = c;
426 _rl_callback_func = 0;
427 _rl_want_redisplay = 1;
434 #if defined (HANDLE_MULTIBYTE)
439 #if defined (HANDLE_MULTIBYTE)
440 ! _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
442 RL_SETSTATE(RL_STATE_MOREINPUT);
443 ! _rl_vi_last_search_char = rl_read_key ();
444 RL_UNSETSTATE(RL_STATE_MOREINPUT);
449 #if defined (HANDLE_MULTIBYTE)
450 ! c = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
453 ! _rl_vi_last_search_mblen = c;
455 RL_SETSTATE(RL_STATE_MOREINPUT);
456 ! c = rl_read_key ();
457 RL_UNSETSTATE(RL_STATE_MOREINPUT);
460 + _rl_vi_last_search_char = c;
466 RL_UNSETSTATE(RL_STATE_MOREINPUT);
471 #if defined (HANDLE_MULTIBYTE)
472 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
476 _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
481 _rl_callback_func = 0;
482 _rl_want_redisplay = 1;
486 _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
491 return (_rl_vi_change_char (count, c, mb));
495 RL_UNSETSTATE(RL_STATE_MOREINPUT);
497 ! if (ch < 'a' || ch > 'z')
501 RL_UNSETSTATE(RL_STATE_MOREINPUT);
503 ! if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
510 ! else if (ch < 'a' || ch > 'z')
516 ! else if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
520 READLINE PATCH REPORT
521 =====================
523 Readline-Release: 5.2
524 Patch-ID: readline52-006
526 Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
527 Bug-Reference-ID: <1178376645.9063.25.camel@localhost>
528 Bug-Reference-URL: http://bugs.gentoo.org/177095
532 The readline display code miscalculated the screen position when performing
533 a redisplay in which the new text occupies more screen space that the old,
534 but takes fewer bytes to do so (e.g., when replacing a shorter string
535 containing multibyte characters with a longer one containing only ASCII).
539 *** ../readline-5.2/display.c Thu Apr 26 11:38:22 2007
540 --- display.c Thu Jul 12 23:10:10 2007
543 /* Non-zero if we're increasing the number of lines. */
544 int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
545 /* Sometimes it is cheaper to print the characters rather than
546 use the terminal's capabilities. If we're growing the number
547 of lines, make sure we actually cause the new line to wrap
548 around on auto-wrapping terminals. */
549 ! if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
551 /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
553 /* Non-zero if we're increasing the number of lines. */
554 int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
555 + /* If col_lendiff is > 0, implying that the new string takes up more
556 + screen real estate than the old, but lendiff is < 0, meaning that it
557 + takes fewer bytes, we need to just output the characters starting
558 + from the first difference. These will overwrite what is on the
559 + display, so there's no reason to do a smart update. This can really
560 + only happen in a multibyte environment. */
563 + _rl_output_some_chars (nfd, temp);
564 + _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
565 + /* If nfd begins before any invisible characters in the prompt,
566 + adjust _rl_last_c_pos to account for wrap_offset and set
567 + cpos_adjusted to let the caller know. */
568 + if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
570 + _rl_last_c_pos -= wrap_offset;
575 /* Sometimes it is cheaper to print the characters rather than
576 use the terminal's capabilities. If we're growing the number
577 of lines, make sure we actually cause the new line to wrap
578 around on auto-wrapping terminals. */
579 ! else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
581 /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
583 READLINE PATCH REPORT
584 =====================
586 Readline-Release: 5.2
587 Patch-ID: readline52-007
589 Bug-Reported-by: Tom Bjorkholm <tom.bjorkholm@ericsson.com>
590 Bug-Reference-ID: <AEA1A32F001C6B4F98614B5B80D7647D01C075E9@esealmw115.eemea.ericsson.se>
591 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-04/msg00004.html
596 An off-by-one error in readline's input buffering caused readline to drop
597 each 511th character of buffered input (e.g., when pasting a large amount
598 of data into a terminal window).
602 *** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
603 --- input.c Tue Jul 17 09:24:21 2007
607 *key = ibuffer[pop_index++];
609 if (pop_index >= ibuffer_len)
614 *key = ibuffer[pop_index++];
616 if (pop_index >= ibuffer_len)
618 + if (pop_index > ibuffer_len)
625 k = (*rl_getc_function) (rl_instream);
627 if (k == NEWLINE || k == RETURN)
631 k = (*rl_getc_function) (rl_instream);
632 ! if (rl_stuff_char (k) == 0)
633 ! break; /* some problem; no more room */
634 if (k == NEWLINE || k == RETURN)
640 ibuffer[push_index++] = key;
642 if (push_index >= ibuffer_len)
644 + if (push_index > ibuffer_len)
648 READLINE PATCH REPORT
649 =====================
651 Readline-Release: 5.2
652 Patch-ID: readline52-008
654 Bug-Reported-by: dAniel hAhler <ubuntu@thequod.de>
655 Bug-Reference-ID: <4702ED8A.5000503@thequod.de>
656 Bug-Reference-URL: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/119938
660 When updating the display after displaying, for instance, a list of possible
661 completions, readline will place the cursor at the wrong position if the
662 prompt contains invisible characters and a newline.
666 *** ../readline-5.2-patched/display.c Mon Aug 6 14:26:29 2007
667 --- display.c Wed Oct 10 22:43:58 2007
672 ! if (_rl_last_c_pos > tx)
674 _rl_backspace (_rl_last_c_pos - tx); /* XXX */
678 ! if (tx >= 0 && _rl_last_c_pos > tx)
680 _rl_backspace (_rl_last_c_pos - tx); /* XXX */
684 register char *ofd, *ols, *oe, *nfd, *nls, *ne;
685 ! int temp, lendiff, wsatend, od, nd;
686 int current_invis_chars;
687 int col_lendiff, col_temp;
690 register char *ofd, *ols, *oe, *nfd, *nls, *ne;
691 ! int temp, lendiff, wsatend, od, nd, o_cpos;
692 int current_invis_chars;
693 int col_lendiff, col_temp;
699 + o_cpos = _rl_last_c_pos;
701 /* When this function returns, _rl_last_c_pos is correct, and an absolute
702 cursor postion in multibyte mode, but a buffer index when not in a
705 invisible characters in the prompt string. Let's see if setting this when
706 we make sure we're at the end of the drawn prompt string works. */
707 ! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
711 invisible characters in the prompt string. Let's see if setting this when
712 we make sure we're at the end of the drawn prompt string works. */
713 ! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 &&
714 ! (_rl_last_c_pos > 0 || o_cpos > 0) &&
715 ! _rl_last_c_pos == prompt_physical_chars)
719 READLINE PATCH REPORT
720 =====================
722 Readline-Release: 5.2
723 Patch-ID: readline52-009
725 Bug-Reported-by: dAniel hAhler <ubuntu@thequod.de>
731 Under some circumstances, readline will incorrectly display a prompt string
732 containing invisible characters after the final newline.
736 *** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400
737 --- display.c 2007-11-10 17:51:29.000000000 -0500
740 local_prompt = expand_prompt (p, &prompt_visible_length,
741 &prompt_last_invisible,
743 &prompt_physical_chars);
746 local_prompt = expand_prompt (p, &prompt_visible_length,
747 &prompt_last_invisible,
748 ! &prompt_invis_chars_first_line,
749 &prompt_physical_chars);
753 local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
755 ! &prompt_invis_chars_first_line,
759 local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
765 READLINE PATCH REPORT
766 =====================
768 Readline-Release: 5.2
769 Patch-ID: readline52-010
771 Bug-Reported-by: Miroslav Lichvar <mlichvar@redhat.com>
772 Bug-Reference-ID: Fri, 02 Nov 2007 14:07:45 +0100
773 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-11/msg00000.html
777 In certain cases when outputting characters at the end of the line,
778 e.g., when displaying the prompt string, readline positions the cursor
779 incorrectly if the prompt string contains invisible characters and the
780 text being drawn begins before the last invisible character in the line.
784 *** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400
785 --- display.c 2007-11-10 17:51:29.000000000 -0500
790 - /* We have horizontal scrolling and we are not inserting at
791 - the end. We have invisible characters in this line. This
792 - is a dumb update. */
793 _rl_output_some_chars (nfd, temp);
794 _rl_last_c_pos += col_temp;
800 _rl_output_some_chars (nfd, temp);
801 _rl_last_c_pos += col_temp;
802 + /* If nfd begins before any invisible characters in the prompt,
803 + adjust _rl_last_c_pos to account for wrap_offset and set
804 + cpos_adjusted to let the caller know. */
805 + if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
807 + _rl_last_c_pos -= wrap_offset;
813 READLINE PATCH REPORT
814 =====================
816 Readline-Release: 5.2
817 Patch-ID: readline52-011
819 Bug-Reported-by: Uwe Doering <gemini@geminix.org>
820 Bug-Reference-ID: <46F3DD72.2090801@geminix.org>
821 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-09/msg00102.html
825 There is an off-by-one error in the code that buffers characters received
826 very quickly in succession, causing characters to be dropped.
830 *** ../readline-5.2-patched/input.c 2007-08-25 13:47:10.000000000 -0400
831 --- input.c 2007-10-12 22:55:25.000000000 -0400
836 ! pop_index = ibuffer_len - 1;
837 ibuffer[pop_index] = key;
842 ! pop_index = ibuffer_len;
843 ibuffer[pop_index] = key;
846 READLINE PATCH REPORT
847 =====================
849 Readline-Release: 5.2
850 Patch-ID: readline52-012
852 Bug-Reported-by: Chet Ramey <chet.ramey@case.edu>
858 This updates the options required to create shared libraries on several
859 systems, including Mac OS X 10.5 (darwin9.x), FreeBSD, NetBSD, OpenBSD,
864 *** ../readline-5.2-patched/support/shobj-conf 2006-04-11 09:15:43.000000000 -0400
865 --- support/shobj-conf 2007-12-06 23:46:41.000000000 -0500
870 ! # Copyright (C) 1996-2002 Free Software Foundation, Inc.
872 # This program is free software; you can redistribute it and/or modify
876 ! # Copyright (C) 1996-2007 Free Software Foundation, Inc.
878 # This program is free software; you can redistribute it and/or modify
883 ! freebsd2* | netbsd*)
895 freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
901 freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
910 SHOBJ_STATUS=supported
911 SHLIB_STATUS=supported
916 SHOBJ_STATUS=supported
917 SHLIB_STATUS=supported
920 SHLIB_LIBSUFF='dylib'
922 ! SHOBJ_LDFLAGS='-undefined dynamic_lookup'
923 SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
926 SHLIB_LIBSUFF='dylib'
928 ! SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
929 SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
935 ! darwin[78]*) SHOBJ_LDFLAGS=''
936 SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
941 ! darwin[789]*) SHOBJ_LDFLAGS=''
942 SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
961 ! aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
967 ! aix4.[2-9]*-*gcc*|aix[5-9].*-*gcc*) # lightly tested by jik@cisco.com
980 ! aix4.[2-9]*|aix[5-9].*)
985 # if you have problems linking here, moving the `-Wl,+h,$@' from
986 # SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
987 ! SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
989 SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
991 # if you have problems linking here, moving the `-Wl,+h,$@' from
992 # SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
993 ! SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
995 SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
997 READLINE PATCH REPORT
998 =====================
1000 Readline-Release: 5.2
1001 Patch-ID: readline52-013
1003 Bug-Reported-by: slinkp <stuff@slinkp.com>
1004 Bug-Reference-ID: <da52a26a-9f38-4861-a918-14d3482b539d@c65g2000hsa.googlegroups.com>
1005 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2008-05/msg00085.html
1009 The presence of invisible characters in a prompt longer than the screenwidth
1010 with invisible characters on the first and last prompt lines caused readline
1011 to place the cursor in the wrong physical location.
1015 *** ../readline-5.2-patched/display.c 2007-12-14 21:12:40.000000000 -0500
1016 --- display.c 2008-10-23 09:39:46.000000000 -0400
1020 OFFSET (which has already been calculated above). */
1022 + #define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
1023 + #define WRAP_OFFSET(line, offset) ((line == 0) \
1024 + ? (offset ? INVIS_FIRST() : 0) \
1025 + : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
1026 #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
1027 #define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
1030 _rl_last_c_pos > wrap_offset &&
1031 o_cpos < prompt_last_invisible)
1032 ! _rl_last_c_pos -= wrap_offset;
1034 /* If this is the line with the prompt, we might need to
1036 _rl_last_c_pos > wrap_offset &&
1037 o_cpos < prompt_last_invisible)
1038 ! _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */
1039 ! else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth &&
1040 ! (MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
1041 ! cpos_adjusted == 0 &&
1042 ! _rl_last_c_pos != o_cpos &&
1043 ! _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line))
1044 ! _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
1046 /* If this is the line with the prompt, we might need to
1050 register char *ofd, *ols, *oe, *nfd, *nls, *ne;
1051 ! int temp, lendiff, wsatend, od, nd, o_cpos;
1052 int current_invis_chars;
1053 int col_lendiff, col_temp;
1056 register char *ofd, *ols, *oe, *nfd, *nls, *ne;
1057 ! int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
1058 int current_invis_chars;
1059 int col_lendiff, col_temp;
1062 temp = _rl_last_c_pos;
1064 ! temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
1065 if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
1066 && _rl_last_v_pos == current_line - 1)
1068 temp = _rl_last_c_pos;
1070 ! temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
1071 if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
1072 && _rl_last_v_pos == current_line - 1)
1076 _rl_output_some_chars (nfd + lendiff, temp - lendiff);
1078 /* XXX -- this bears closer inspection. Fixes a redisplay bug
1079 reported against bash-3.0-alpha by Andreas Schwab involving
1080 multibyte characters and prompt strings with invisible
1081 characters, but was previously disabled. */
1082 ! _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
1084 ! _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
1090 _rl_output_some_chars (nfd + lendiff, temp - lendiff);
1091 /* XXX -- this bears closer inspection. Fixes a redisplay bug
1092 reported against bash-3.0-alpha by Andreas Schwab involving
1093 multibyte characters and prompt strings with invisible
1094 characters, but was previously disabled. */
1095 ! if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
1096 ! twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
1098 ! twidth = temp - lendiff;
1099 ! _rl_last_c_pos += twidth;
1104 int cpos, dpos; /* current and desired cursor positions */
1106 ! woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
1107 cpos = _rl_last_c_pos;
1108 #if defined (HANDLE_MULTIBYTE)
1110 int cpos, dpos; /* current and desired cursor positions */
1112 ! woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
1113 cpos = _rl_last_c_pos;
1114 #if defined (HANDLE_MULTIBYTE)
1117 prompt string, since they're both buffer indices and DPOS is a
1118 desired display position. */
1119 ! if (new > prompt_last_invisible) /* XXX - don't use woff here */
1123 prompt string, since they're both buffer indices and DPOS is a
1124 desired display position. */
1125 ! if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
1126 ! (prompt_physical_chars > _rl_screenwidth &&
1127 ! _rl_last_v_pos == prompt_last_screen_line &&
1128 ! wrap_offset != woff &&
1129 ! new > (prompt_last_invisible-_rl_screenwidth-wrap_offset)))