head 1.6; access; symbols OPENPKG_2_STABLE_MP:1.5 OPENPKG_E1_MP_HEAD:1.5 OPENPKG_E1_MP:1.5 OPENPKG_E1_MP_2_STABLE:1.5 OPENPKG_E1_FP:1.5 OPENPKG_2_STABLE_20061018:1.5 OPENPKG_2_STABLE:1.5.0.2 OPENPKG_2_STABLE_BP:1.5 OPENPKG_2_5_RELEASE:1.4 OPENPKG_2_5_SOLID:1.4.0.6 OPENPKG_2_5_SOLID_BP:1.4 OPENPKG_2_4_RELEASE:1.4 OPENPKG_2_4_SOLID:1.4.0.4 OPENPKG_2_4_SOLID_BP:1.4 OPENPKG_CW_FP:1.4 OPENPKG_2_3_RELEASE:1.4 OPENPKG_2_3_SOLID:1.4.0.2 OPENPKG_2_3_SOLID_BP:1.4 OPENPKG_2_2_RELEASE:1.3 OPENPKG_2_2_SOLID:1.3.0.2 OPENPKG_2_2_SOLID_BP:1.3 OPENPKG_2_1_RELEASE:1.1 OPENPKG_2_1_SOLID:1.1.0.2 OPENPKG_2_1_SOLID_BP:1.1; locks; strict; comment @# @; 1.6 date 2009.03.07.14.09.34; author rse; state Exp; branches; next 1.5; commitid KJ1BdstwjWk3J6Ft; 1.5 date 2005.12.08.19.08.16; author rse; state dead; branches; next 1.4; commitid rud3etxmT1S6tQcr; 1.4 date 2004.12.07.09.51.35; author rse; state Exp; branches; next 1.3; 1.3 date 2004.10.02.10.23.16; author rse; state Exp; branches; next 1.2; 1.2 date 2004.08.04.10.59.29; author tho; state dead; branches; next 1.1; 1.1 date 2004.06.04.18.52.03; author rse; state Exp; branches; next ; desc @@ 1.6 log @avoid symbol conflicts between readline's xmalloc stuff and variants of an application using readline @ text @Index: xmalloc.h --- xmalloc.h.orig 2009-01-04 20:32:34 +0100 +++ xmalloc.h 2009-03-07 15:05:14 +0100 @@@@ -38,6 +38,10 @@@@ #endif /* !PTR_T */ +#define xmalloc readline_xmalloc +#define xrealloc readline_xrealloc +#define xfree readline_xfree + extern PTR_T xmalloc PARAMS((size_t)); extern PTR_T xrealloc PARAMS((void *, size_t)); extern void xfree PARAMS((void *)); @ 1.5 log @upgrading package: readline 5.0.5 -> 5.1.0 @ text @d1 4 a4 9 This patch adds an explicit recognition for terminal sequence "kD" to be "Delete" key. This is derived from Debian GNU/Linux and SuSE Linux. Index: terminal.c --- terminal.c.orig 2003-09-18 17:03:42 +0200 +++ terminal.c 2004-07-27 20:03:17 +0200 @@@@ -145,6 +145,9 @@@@ static char *_rl_term_kH; static char *_rl_term_at7; /* @@7 */ d6 5 a10 2 +/* The key sequence sent by the Delete key, if any. */ +static char *_rl_term_kD; d12 3 a14 20 /* Insert key */ static char *_rl_term_kI; @@@@ -313,6 +316,7 @@@@ { "ei", &_rl_term_ei }, { "ic", &_rl_term_ic }, { "im", &_rl_term_im }, + { "kD", &_rl_term_kD }, /* delete */ { "kH", &_rl_term_kH }, /* home down ?? */ { "kI", &_rl_term_kI }, /* insert */ { "kd", &_rl_term_kd }, @@@@ -492,6 +496,7 @@@@ rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */ rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */ + rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); /* Delete */ _rl_keymap = xkeymap; } @ 1.4 log @update URLs; replace own patches from Bash with official Readline patches @ text @@ 1.3 log @apply GNU readline related patches from the official GNU bash patch set @ text @a33 197 ----------------------------------------------------------------------------- These are the accumulated patches to GNU readline as contained in the official GNU bash 3.0 patches numbered 001 to 013. Index: display.c --- display.c.orig 2004-10-02 12:19:25 +0200 +++ display.c 2004-10-02 12:19:25 +0200 @@@@ -201,7 +201,7 @@@@ int *lp, *lip, *niflp, *vlp; { char *r, *ret, *p; - int l, rl, last, ignoring, ninvis, invfl, ind, pind, physchars; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; /* Short-circuit if we can. */ if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) @@@@ -222,6 +222,7 @@@@ r = ret = (char *)xmalloc (l + 1); invfl = 0; /* invisible chars in first line of prompt */ + invflset = 0; /* we only want to set invfl once */ for (rl = ignoring = last = ninvis = physchars = 0, p = pmt; p && *p; p++) { @@@@ -249,7 +250,10 @@@@ while (l--) *r++ = *p++; if (!ignoring) - rl += ind - pind; + { + rl += ind - pind; + physchars += _rl_col_width (pmt, pind, ind); + } else ninvis += ind - pind; p--; /* compensate for later increment */ @@@@ -259,16 +263,19 @@@@ { *r++ = *p; if (!ignoring) - rl++; /* visible length byte counter */ + { + rl++; /* visible length byte counter */ + physchars++; + } else ninvis++; /* invisible chars byte counter */ } - if (rl >= _rl_screenwidth) - invfl = ninvis; - - if (ignoring == 0) - physchars++; + if (invflset == 0 && rl >= _rl_screenwidth) + { + invfl = ninvis; + invflset = 1; + } } } @@@@ -417,7 +424,7 @@@@ register int in, out, c, linenum, cursor_linenum; register char *line; int c_pos, inv_botlin, lb_botlin, lb_linenum; - int newlines, lpos, temp, modmark; + int newlines, lpos, temp, modmark, n0, num; char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) wchar_t wc; @@@@ -573,6 +580,7 @@@@ #if defined (HANDLE_MULTIBYTE) memset (_rl_wrapped_line, 0, vis_lbsize); + num = 0; #endif /* prompt_invis_chars_first_line is the number of invisible characters in @@@@ -591,13 +599,32 @@@@ probably too much work for the benefit gained. How many people have prompts that exceed two physical lines? Additional logic fix from Edward Catmur */ +#if defined (HANDLE_MULTIBYTE) + n0 = num; + temp = local_prompt ? strlen (local_prompt) : 0; + while (num < temp) + { + if (_rl_col_width (local_prompt, n0, num) > _rl_screenwidth) + { + num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY); + break; + } + num++; + } + temp = num + +#else temp = ((newlines + 1) * _rl_screenwidth) + +#endif /* !HANDLE_MULTIBYTE */ ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line : ((newlines == 1) ? wrap_offset : 0)) : ((newlines == 0) ? wrap_offset :0)); inv_lbreaks[++newlines] = temp; +#if defined (HANDLE_MULTIBYTE) + lpos -= _rl_col_width (local_prompt, n0, num); +#else lpos -= _rl_screenwidth; +#endif } prompt_last_screen_line = newlines; Index: mbutil.c --- mbutil.c.orig 2004-01-14 15:44:52 +0100 +++ mbutil.c 2004-10-02 12:19:25 +0200 @@@@ -126,11 +126,11 @@@@ if (find_non_zero) { tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); - while (wcwidth (wc) == 0) + while (tmp > 0 && wcwidth (wc) == 0) { point += tmp; tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); - if (tmp == (size_t)(0) || tmp == (size_t)(-1) || tmp == (size_t)(-2)) + if (MB_NULLWCH (tmp) || MB_INVALIDCH (tmp)) break; } } Index: misc.c --- misc.c.orig 2004-07-07 14:56:32 +0200 +++ misc.c 2004-10-02 12:19:25 +0200 @@@@ -276,12 +276,6 @@@@ _rl_saved_line_for_history->line = savestring (rl_line_buffer); _rl_saved_line_for_history->data = (char *)rl_undo_list; } - else if (STREQ (rl_line_buffer, _rl_saved_line_for_history->line) == 0) - { - free (_rl_saved_line_for_history->line); - _rl_saved_line_for_history->line = savestring (rl_line_buffer); - _rl_saved_line_for_history->data = (char *)rl_undo_list; /* XXX possible memleak */ - } return 0; } Index: vi_mode.c --- vi_mode.c.orig 2004-10-02 12:19:25 +0200 +++ vi_mode.c 2004-10-02 12:19:25 +0200 @@@@ -692,7 +692,7 @@@@ { wchar_t wc; char mb[MB_LEN_MAX+1]; - int mblen; + int mblen, p; mbstate_t ps; memset (&ps, 0, sizeof (mbstate_t)); @@@@ -715,11 +715,14 @@@@ /* Vi is kind of strange here. */ if (wc) { + p = rl_point; mblen = wcrtomb (mb, wc, &ps); if (mblen >= 0) mb[mblen] = '\0'; rl_begin_undo_group (); - rl_delete (1, 0); + rl_vi_delete (1, 0); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; /* XXX - should we advance more than 1 for mbchar? */ rl_insert_text (mb); rl_end_undo_group (); rl_vi_check (); @@@@ -1312,12 +1315,16 @@@@ rl_vi_delete (1, c); #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - while (_rl_insert_char (1, c)) - { - RL_SETSTATE (RL_STATE_MOREINPUT); - c = rl_read_key (); - RL_UNSETSTATE (RL_STATE_MOREINPUT); - } + { + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; + while (_rl_insert_char (1, c)) + { + RL_SETSTATE (RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE (RL_STATE_MOREINPUT); + } + } else #endif { @ 1.2 log @upgrading package: readline 4.3.5 -> 5.0.0 @ text @d1 142 a142 11 Index: rlmbutil.h --- rlmbutil.h.orig 2001-12-20 15:54:38.000000000 +0100 +++ rlmbutil.h 2004-06-04 20:50:28.000000000 +0200 @@@@ -33,6 +33,11 @@@@ support user defined character classes. */ /* Solaris 2.5 has a bug: must be included before . */ #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) +#if defined (__hpux) +#include +#include +#define _INCLUDE__STDC_A1_SOURCE d144 87 a230 3 # include # include # if defined (HAVE_MBSRTOWCS) /* system is supposed to support XPG5 */ @ 1.1 log @port to HP-UX 11.11 @ text @@