rpms/compat-readline5/devel compat-readline5.spec, NONE, 1.1 readline-5.2-redisplay-sigint.patch, NONE, 1.1 readline-5.2-shlib.patch, NONE, 1.1 readline52-001, NONE, 1.1 readline52-002, NONE, 1.1 readline52-003, NONE, 1.1 readline52-004, NONE, 1.1 readline52-005, NONE, 1.1 readline52-006, NONE, 1.1 readline52-007, NONE, 1.1 readline52-008, NONE, 1.1 readline52-009, NONE, 1.1 readline52-010, NONE, 1.1 readline52-011, NONE, 1.1 readline52-013, NONE, 1.1 readline52-014, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Miroslav Lichvar mlichvar at fedoraproject.org
Tue Jul 14 11:49:17 UTC 2009


Author: mlichvar

Update of /cvs/pkgs/rpms/compat-readline5/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6351

Modified Files:
	.cvsignore sources 
Added Files:
	compat-readline5.spec readline-5.2-redisplay-sigint.patch 
	readline-5.2-shlib.patch readline52-001 readline52-002 
	readline52-003 readline52-004 readline52-005 readline52-006 
	readline52-007 readline52-008 readline52-009 readline52-010 
	readline52-011 readline52-013 readline52-014 
Log Message:
- import package



--- NEW FILE compat-readline5.spec ---
Summary: A library for editing typed command lines
Name: compat-readline5
Version: 5.2
Release: 16%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
Source: ftp://ftp.gnu.org/gnu/readline/readline-%{version}.tar.gz
Patch1: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-001
Patch2: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-002
Patch3: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-003
Patch4: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-004
Patch5: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-005
Patch6: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-006
Patch7: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-007
Patch8: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-008
Patch9: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-009
Patch10: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-010
Patch11: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-011
Patch12: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-013
Patch13: ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-014
# fix file permissions, remove RPATH, use CFLAGS
Patch20: readline-5.2-shlib.patch
# fixed in readline-6.0
Patch21: readline-5.2-redisplay-sigint.patch
BuildRequires: ncurses-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
The Readline library provides a set of functions that allow users to
edit command lines. Both Emacs and vi editing modes are available. The
Readline library includes additional functions for maintaining a list
of previously-entered command lines for recalling or editing those
lines, and for performing csh-like history expansion on previous
commands.

%package devel
Summary: Files needed to develop programs which use the readline library
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: ncurses-devel

%description devel
The Readline library provides a set of functions that allow users to
edit typed command lines. If you want to develop programs that will
use the readline library, you need to have the readline-devel package
installed. You also need to have the readline package installed.

%package static
Summary: Static libraries for the readline library
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description static
The readline-static package contains the static version of the readline
library.

%prep
%setup -q -n readline-%{version}
%patch1 -p0 -b .001
%patch2 -p0 -b .002
%patch3 -p0 -b .003
%patch4 -p0 -b .004
%patch5 -p0 -b .005
%patch6 -p0 -b .006
%patch7 -p0 -b .007
%patch8 -p0 -b .008
%patch9 -p0 -b .009
%patch10 -p0 -b .010
%patch11 -p0 -b .011
%patch12 -p0 -b .013
%patch13 -p0 -b .014
%patch20 -p1 -b .shlib
%patch21 -p1 -b .redisplay-sigint

%build
export CPPFLAGS="-I%{_includedir}/ncurses"
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

mkdir -p $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/readline5}
mv $RPM_BUILD_ROOT%{_libdir}/libreadline.so.* $RPM_BUILD_ROOT/%{_lib}
mv $RPM_BUILD_ROOT%{_libdir}/lib*.a $RPM_BUILD_ROOT%{_libdir}/readline5

rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.so
ln -sf ../../../%{_lib}/libreadline.so.5 $RPM_BUILD_ROOT%{_libdir}/readline5/libreadline.so
ln -sf ../libhistory.so.5 $RPM_BUILD_ROOT%{_libdir}/readline5/libhistory.so

mkdir $RPM_BUILD_ROOT%{_includedir}/readline5
mv $RPM_BUILD_ROOT%{_includedir}/readline{,5}

rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT%{_mandir}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGES COPYING NEWS README USAGE
/%{_lib}/libreadline*.so.*
%{_libdir}/libhistory*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/readline5
%dir %{_libdir}/readline5
%{_libdir}/readline5/lib*.so

%files static
%defattr(-,root,root,-)
%{_libdir}/readline5/lib*.a

%changelog
* Wed Jul 08 2009 Miroslav Lichvar <mlichvar at redhat.com> 5.2-16
- review fixes (#510022)

* Thu Jul 07 2009 Miroslav Lichvar <mlichvar at redhat.com> 5.2-15
- make compat package
- include upstream patches 013, 014

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.2-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sun Mar 23 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 5.2-13
- Fix the previous %%changelog entry authorship.

* Sun Mar 23 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 5.2-12
- Fix excessive prompts on CTRL-C abort while the prompt is being printed.

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 5.2-11
- Autorebuild for GCC 4.3

* Fri Jan 18 2008 Miroslav Lichvar <mlichvar at redhat.com> 5.2-10
- move libreadline to /lib

* Thu Jan 03 2008 Miroslav Lichvar <mlichvar at redhat.com> 5.2-9
- include upstream patches 008-011

* Mon Nov 05 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-8
- fix cursor position when prompt has one invisible character (#358231)
- merge review fixes (#226361)
- fix source URL

* Mon Aug 27 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-7
- include patches 005, 006, 007

* Wed Aug 22 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-6
- update license tag

* Tue May 29 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-5
- include patches 5.2-003, 5.2-004

* Thu Mar 22 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-4
- apply 5.2-002 patch

* Thu Mar 15 2007 Miroslav Lichvar <mlichvar at redhat.com> 5.2-3
- link libreadline with libtinfo (#232277)
- include upstream 5.2-001 patch
- move static libraries to -static subpackage, spec cleanup

* Thu Nov 30 2006 Miroslav Lichvar <mlichvar at redhat.com> 5.2-2
- require ncurses-devel instead of libtermcap-devel

* Mon Nov 13 2006 Miroslav Lichvar <mlichvar at redhat.com> 5.2-1
- update to 5.2 (#213795)
- use CFLAGS when linking (#199374)
- package docs and examples (#172497)
- spec cleanup

* Wed Jul 12 2006 Jesse Keating <jkeating at redhat.com> - 5.1-1.1
- rebuild

* Mon Jul 10 2006 Jindrich Novy <jnovy at redhat.com> 5.1-1
- update to readline-5.1
- apply new proposed upstream patches for 5.1 (001-004)
- drop "read -e" patch, applied upstream

* Fri Feb 10 2006 Jesse Keating <jkeating at redhat.com> - 5.0-3.2.1
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating at redhat.com> - 5.0-3.2
- rebuilt for new gcc4.1 snapshot and glibc changes

* Fri Dec 09 2005 Jesse Keating <jkeating at redhat.com>
- rebuilt

* Wed Mar  2 2005 Tim Waugh <twaugh at redhat.com> 5.0-3
- Rebuild for new GCC.

* Tue Jan 18 2005 Tim Waugh <twaugh at redhat.com> 5.0-2
- Fix line-wrapping (bug #145329).
- Apply "read -e" patch from bash package.

* Wed Jan 12 2005 Tim Waugh <twaugh at redhat.com> 5.0-1
- 5.0 (bug #144835).

* Mon Nov 29 2004 Tim Waugh <twaugh at redhat.com> 4.3-14
- Added URL tag (bug #141106).

* Thu Sep  2 2004 Jeremy Katz <katzj at redhat.com> - 4.3-13
- rebuild so that static linking against readline will work on ppc64 
  without dot symbols

* Mon Jun 28 2004 Tim Waugh <twaugh at redhat.com> 4.3-12
- Build requires libtool (bug #126589).

* Tue Jun 15 2004 Elliot Lee <sopwith at redhat.com>
- rebuilt

* Tue Mar 02 2004 Elliot Lee <sopwith at redhat.com>
- rebuilt

* Fri Feb 13 2004 Elliot Lee <sopwith at redhat.com>
- rebuilt

* Fri Nov 28 2003 Thomas Woerner <twoerner at redhat.com> 4.3-9
- removed rpath

* Thu Nov  6 2003 Tim Waugh <twaugh at redhat.com> 4.3-8
- Apply upstream patches (bug #109240 among others).

* Wed Jun 25 2003 Tim Waugh <twaugh at redhat.com>
- devel package requires libtermcap-devel (bug #98015).

* Wed Jun 25 2003 Tim Waugh <twaugh at redhat.com> 4.3-7
- Fixed recursion loop (bug #92372).

* Wed Jun 04 2003 Elliot Lee <sopwith at redhat.com>
- rebuilt

* Wed Jan 22 2003 Tim Powers <timp at redhat.com>
- rebuilt

* Wed Nov 20 2002 Tim Powers <timp at redhat.com>
- rebuild in current collinst
- BuildRequires autoconf only

* Wed Aug 07 2002 Phil Knirsch <pknirsch at redhat.com> 4.3-3
- Fixed Esc-O-M stack overflow bug.

* Mon Jul 22 2002 Phil Knirsch <pknirsch at redhat.com> 4.3-1
- Updated to latest readline release 4.3

* Thu Jul 11 2002 Phil Knirsch <pknirsch at redhat.com> 4.2a-7
- Fixed problem with alpha build.

* Wed Jul 10 2002 Phil Knirsch <pknirsch at redhat.com>
- Fixed utf8 problem (originally observed in bash).

* Fri Jun 21 2002 Tim Powers <timp at redhat.com> 4.2a-6
- automated rebuild

* Thu May 23 2002 Tim Powers <timp at redhat.com> 4.2a-5
- automated rebuild

* Wed Mar 20 2002 Trond Eivind Glomsrød <teg at redhat.com> 4.2a-4
- Use autoconf 2.53, not 2.52

* Mon Mar  4 2002 Bernhard Rosenkraenzer <bero at redhat.com> 4.2a-3
- Rebuild

* Mon Nov 26 2001 Matt Wilson <msw at redhat.com> 4.2a-2
- removed the manual symlinking of .so, readline handles this by itself
- call only %%makeinstall, not %%makeinstall install install-shared as
  this makes bogus .old files in the buildroot

* Tue Nov 20 2001 Bernhard Rosenkraenzer <bero at redhat.com> 4.2a-1
- 4.2a

* Tue Oct  2 2001 Bernhard Rosenkraenzer <bero at redhat.com> 4.2-4
- Work around autoconf bug

* Mon Oct  1 2001 Bernhard Rosenkraenzer <bero at redhat.com> 4.2-3
- Don't use readline's internal re-implementation of strpbrk on systems
  that have strpbrk - the system implementation is faster and better maintained.

* Tue Aug  7 2001 Bernhard Rosenkraenzer <bero at redhat.com> 4.2-2
- Make sure headers can be included from C++ applications (#51131)
  (Patch based on Debian's with the bugs removed ;) )

* Wed May 09 2001 Florian La Roche <Florian.LaRoche at redhat.de>
- update to 4.2 and adapt patches

* Fri Apr  6 2001 Nalin Dahyabhai <nalin at redhat.com>
- change the paths listed for the header files in the man page to reflect
  the location changes from previous versions (#35073)
- note that "on" is acceptable instead of "On" in the man page (#21327)

* Thu Mar  8 2001 Preston Brown <pbrown at redhat.com>
- fix reading of end key termcap value (@7 is correct, was kH) (#30884)

* Tue Jan 30 2001 Nalin Dahyabhai <nalin at redhat.com>
- mark the man page as currently out-of-date (#25294)

* Thu Sep  7 2000 Jeff Johnson <jbj at redhat.com>
- FHS packaging (64bit systems need to use libdir).

* Thu Aug 17 2000 Jeff Johnson <jbj at redhat.com>
- summaries from specspo.

* Wed Aug  2 2000 Florian La Roche <Florian.LaRoche at redhat.com>
- use "rm -f" in specfile

* Wed Jul 12 2000 Prospector <bugzilla at redhat.com>
- automatic rebuild

* Mon Jun  5 2000 Jeff Johnson <jbj at redhat.com>
- FHS packaging.

* Tue Mar 21 2000 Bernhard Rosenkraenzer <bero at redhat.com>
- 4.1

* Thu Feb 03 2000 Nalin Dahyabhai <nalin at redhat.com>
- update to 4.0

* Fri Apr 09 1999 Michael K. Johnson <johnsonm at redhat.com>
- added guard patch from Taneli Huuskonen <huuskone at cc.helsinki.fi>

* Sun Mar 21 1999 Cristian Gafton <gafton at redhat.com> 
- auto rebuild in the new build environment (release 4)

* Sun Jul 26 1998 Jeff Johnson <jbj at redhat.com>
- updated to 2.2.1

* Wed May 06 1998 Prospector System <bugs at redhat.com>
- translations modified for de, fr, tr

* Wed May 06 1998 Cristian Gafton <gafton at redhat.com>
- don't package /usr/info/dir

* Thu Apr 30 1998 Cristian Gafton <gafton at redhat.com>
- devel package moved to Development/Libraries

* Tue Apr 21 1998 Cristian Gafton <gafton at redhat.com>
- updated to 2.2

* Tue Oct 14 1997 Donnie Barnes <djb at redhat.com>
- spec file cleanups

* Fri Oct 10 1997 Erik Troan <ewt at redhat.com>
- added proper sonames

* Tue Jul 08 1997 Erik Troan <ewt at redhat.com>
- updated to readline 2.1

* Tue Jun 03 1997 Erik Troan <ewt at redhat.com>
- built against glibc

readline-5.2-redisplay-sigint.patch:

--- NEW FILE readline-5.2-redisplay-sigint.patch ---
GDB PR 544: gdb.cp/annota2.exp and gdb.cp/annota3.exp sometimes FAIL with:
	FAIL: gdb.cp/annota3.exp: annotate-quit (pattern 1)

One can put `sleep (1)' at the end of _RL_OUTPUT_SOME_CHARS and type
	p 1<enter><ctrl-c>
to abort the prompt printing. Before the patch:
	(gdb) p 1
	$1 = 1
	Quit) (gdb) 
	(gdb) _
After the patch:
	[bash]jkratoch at host0.dyn.jankratochvil.net:/home/jkratoch/redhat/sources/readline# ../gdb/gdb -nx -silent(gdb) p 1
	$1 = 1
	(gdb) Quit
	(gdb) _

The readline patch posted upstream:
	http://sourceware.org/ml/gdb-patches/2008-03/msg00317.html

On Fri, 21 Mar 2008 19:37:31 +0100, Chet Ramey wrote:
> I will add something like your block_sigint/release_sigint changes around
> the guts of rl_redisplay.  That's the right thing to do anyway.  It will
> probably not come out as a patch for readline-5.2; you can use your
> current patch (though the names will change to _rl_block_sigint and
> _rl_release_sigint -- fair warning).

Application cannot easily supply its own RL_REDISPLAY_FUNCTION as a custom
function there changes the readline behavior:
	http://sourceware.org/ml/gdb-patches/2008-03/msg00340.html

BLOCK_SIGINT / RELEASE_SIGINT: Make it public and prefix it by `_rl_'.
RL_REDISPLAY: Wrap it by _RL_BLOCK_SIGINT / _RL_RELEASE_SIGINT.

--- readline-5.2-orig/display.c	2008-03-23 20:52:12.000000000 +0100
+++ readline-5.2/display.c	2008-03-23 20:56:58.000000000 +0100
@@ -472,6 +472,10 @@ rl_redisplay ()
   if (!readline_echoing_p)
     return;
 
+  /* Signals are blocked through this function as the global data structures
+     could get corrupted upon modifications from an invoked signal handler. */
+  _rl_block_sigint ();
+
   if (!rl_display_prompt)
     rl_display_prompt = "";
 
@@ -1180,6 +1184,8 @@ rl_redisplay ()
     else
       visible_wrap_offset = wrap_offset;
   }
+
+  _rl_release_sigint ();
 }
 
 /* PWP: update_line() is based on finding the middle difference of each
--- readline-5.2-orig/rltty.c	2005-12-26 23:21:50.000000000 +0100
+++ readline-5.2/rltty.c	2008-03-23 20:57:26.000000000 +0100
@@ -52,8 +52,8 @@ extern int errno;
 rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
 rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
 
-static void block_sigint PARAMS((void));
-static void release_sigint PARAMS((void));
+void _rl_block_sigint PARAMS((void));
+void _rl_release_sigint PARAMS((void));
 
 static void set_winsize PARAMS((int));
 
@@ -74,9 +74,9 @@ static int sigint_oldmask;
 static int sigint_blocked;
 
 /* Cause SIGINT to not be delivered until the corresponding call to
-   release_sigint(). */
-static void
-block_sigint ()
+   _rl_release_sigint(). */
+void
+_rl_block_sigint ()
 {
   if (sigint_blocked)
     return;
@@ -100,8 +100,8 @@ block_sigint ()
 }
 
 /* Allow SIGINT to be delivered. */
-static void
-release_sigint ()
+void
+_rl_release_sigint ()
 {
   if (sigint_blocked == 0)
     return;
@@ -663,7 +663,7 @@ rl_prep_terminal (meta_flag)
     return;
 
   /* Try to keep this function from being INTerrupted. */
-  block_sigint ();
+  _rl_block_sigint ();
 
   tty = fileno (rl_instream);
 
@@ -676,7 +676,7 @@ rl_prep_terminal (meta_flag)
       if (errno == ENOTTY)
 #endif
 	readline_echoing_p = 1;		/* XXX */
-      release_sigint ();
+      _rl_release_sigint ();
       return;
     }
 
@@ -711,7 +711,7 @@ rl_prep_terminal (meta_flag)
 
   if (set_tty_settings (tty, &tio) < 0)
     {
-      release_sigint ();
+      _rl_release_sigint ();
       return;
     }
 
@@ -722,7 +722,7 @@ rl_prep_terminal (meta_flag)
   terminal_prepped = 1;
   RL_SETSTATE(RL_STATE_TERMPREPPED);
 
-  release_sigint ();
+  _rl_release_sigint ();
 }
 
 /* Restore the terminal's normal settings and modes. */
@@ -735,7 +735,7 @@ rl_deprep_terminal ()
     return;
 
   /* Try to keep this function from being interrupted. */
-  block_sigint ();
+  _rl_block_sigint ();
 
   tty = fileno (rl_instream);
 
@@ -746,14 +746,14 @@ rl_deprep_terminal ()
 
   if (set_tty_settings (tty, &otio) < 0)
     {
-      release_sigint ();
+      _rl_release_sigint ();
       return;
     }
 
   terminal_prepped = 0;
   RL_UNSETSTATE(RL_STATE_TERMPREPPED);
 
-  release_sigint ();
+  _rl_release_sigint ();
 }
 #endif /* !NO_TTY_DRIVER */
 
--- readline-5.2-orig/rltty.h	2003-02-01 04:43:11.000000000 +0100
+++ readline-5.2/rltty.h	2008-03-23 20:57:30.000000000 +0100
@@ -79,4 +79,7 @@ typedef struct _rl_tty_chars {
   unsigned char t_status;
 } _RL_TTY_CHARS;
 
+extern void _rl_block_sigint PARAMS((void));
+extern void _rl_release_sigint PARAMS((void));
+
 #endif /* _RLTTY_H_ */

readline-5.2-shlib.patch:

--- NEW FILE readline-5.2-shlib.patch ---
--- readline-5.2/support/shlib-install.shlib	2006-01-03 20:06:27.000000000 +0100
+++ readline-5.2/support/shlib-install	2006-11-13 13:51:02.000000000 +0100
@@ -71,7 +71,7 @@
 case "$host_os" in
 hpux*|darwin*|macosx*|linux*)
 	if [ -z "$uninstall" ]; then
-		chmod 555 ${INSTALLDIR}/${LIBNAME}
+		chmod 755 ${INSTALLDIR}/${LIBNAME}
 	fi ;;
 cygwin*)
 	IMPLIBNAME=`echo ${LIBNAME} \
--- readline-5.2/support/shobj-conf.shlib	2006-04-11 15:15:43.000000000 +0200
+++ readline-5.2/support/shobj-conf	2007-03-15 14:11:36.000000000 +0100
@@ -108,10 +108,11 @@
 linux*-*|gnu*-*|k*bsd*-gnu-*)
 	SHOBJ_CFLAGS=-fPIC
 	SHOBJ_LD='${CC}'
-	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+	SHOBJ_LDFLAGS='$(CFLAGS) -shared -Wl,-soname,$@'
 
-	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+	SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+	SHLIB_LIBS='-ltinfo'
 	;;
 
 freebsd2* | netbsd*)
--- readline-5.2/shlib/Makefile.in.shlib	2005-08-12 05:56:10.000000000 +0200
+++ readline-5.2/shlib/Makefile.in	2007-11-05 18:59:14.000000000 +0100
@@ -168,7 +168,7 @@ $(SHARED_READLINE):	$(SHARED_OBJ)
 
 $(SHARED_HISTORY):	$(SHARED_HISTOBJ) xmalloc.so
 	$(RM) $@
-	$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so $(SHLIB_LIBS)
+	$(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so
 
 # Since tilde.c is shared between readline and bash, make sure we compile 
 # it with the right flags when it's built as part of readline


--- NEW FILE readline52-001 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-001

Bug-Reported-by:	ebb9 at byu.net
Bug-Reference-ID:	<45540862.9030900 at byu.net>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00017.html
			http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00016.html

Bug-Description:

In some cases, code that is intended to be used in the presence of multibyte
characters is called when no such characters are present, leading to incorrect
display position calculations and incorrect redisplay.

Patch:

*** ../readline-5.2/display.c	Thu Sep 14 14:20:12 2006
--- display.c	Mon Nov 13 17:55:57 2006
***************
*** 2381,2384 ****
--- 2409,2414 ----
    if (end <= start)
      return 0;
+   if (MB_CUR_MAX == 1 || rl_byte_oriented)
+     return (end - start);
  
    memset (&ps, 0, sizeof (mbstate_t));


--- NEW FILE readline52-002 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-002

Bug-Reported-by: Magnus Svensson <msvensson at mysql.com>
Bug-Reference-ID: <45BDC44D.80609 at mysql.com>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html

Bug-Description:

Readline neglects to reallocate the array it uses to keep track of wrapped
screen lines when increasing its size.  This will eventually result in
segmentation faults when given sufficiently long input.

Patch:

*** ../readline-5.2-patched/display.c	Thu Sep 14 14:20:12 2006
--- display.c	Fri Feb  2 20:23:17 2007
***************
*** 561,574 ****
--- 561,586 ----
        wrap_offset = prompt_invis_chars_first_line = 0;
      }
  
+ #if defined (HANDLE_MULTIBYTE)
  #define CHECK_INV_LBREAKS() \
        do { \
  	if (newlines >= (inv_lbsize - 2)) \
  	  { \
  	    inv_lbsize *= 2; \
  	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ 	    _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
  	  } \
        } while (0)
+ #else
+ #define CHECK_INV_LBREAKS() \
+       do { \
+ 	if (newlines >= (inv_lbsize - 2)) \
+ 	  { \
+ 	    inv_lbsize *= 2; \
+ 	    inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ 	  } \
+       } while (0)
+ #endif /* HANDLE_MULTIBYTE */
  
  #if defined (HANDLE_MULTIBYTE)	  
  #define CHECK_LPOS() \


--- NEW FILE readline52-003 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-003

Bug-Reported-by: Peter Volkov <torre_cremata at mail.ru>
Bug-Reference-ID: <1171795523.8021.18.camel at localhost>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-02/msg00054.html

Bug-Description:

When moving the cursor, bash sometimes misplaces the cursor when the prompt
contains two or more multibyte characters.  The particular circumstance that
uncovered the problem was having the (multibyte) current directory name in
the prompt string.

Patch:

*** ../readline-5.2.2/display.c	Fri Jan 19 13:34:50 2007
--- display.c	Sat Mar 10 17:25:44 2007
***************
*** 1745,1749 ****
      {
        dpos = _rl_col_width (data, 0, new);
!       if (dpos > prompt_last_invisible)		/* XXX - don't use woff here */
  	{
  	  dpos -= woff;
--- 1745,1752 ----
      {
        dpos = _rl_col_width (data, 0, new);
!       /* Use NEW when comparing against the last invisible character in the
! 	 prompt string, since they're both buffer indices and DPOS is a
! 	 desired display position. */
!       if (new > prompt_last_invisible)		/* XXX - don't use woff here */
  	{
  	  dpos -= woff;


--- NEW FILE readline52-004 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-004

Bug-Reported-by: Peter Volkov <torre_cremata at mail.ru>
Bug-Reference-ID: <1173636022.7039.36.camel at localhost>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html

Bug-Description:

When restoring the original prompt after finishing an incremental search,
bash sometimes places the cursor incorrectly if the primary prompt contains
invisible characters.

Patch:

*** ../readline-5.2.3/display.c	Fri Apr 20 13:30:16 2007
--- display.c	Fri Apr 20 15:17:01 2007
***************
*** 1599,1604 ****
  	  if (temp > 0)
  	    {
  	      _rl_output_some_chars (nfd, temp);
! 	      _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
  	    }
  	}
--- 1599,1618 ----
  	  if (temp > 0)
  	    {
+ 	      /* If nfd begins at the prompt, or before the invisible
+ 		 characters in the prompt, we need to adjust _rl_last_c_pos
+ 		 in a multibyte locale to account for the wrap offset and
+ 		 set cpos_adjusted accordingly. */
  	      _rl_output_some_chars (nfd, temp);
! 	      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
! 		{
!                   _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
!                   if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
! 		    {
! 		      _rl_last_c_pos -= wrap_offset;
! 		      cpos_adjusted = 1;
! 		    }
! 		}
!               else
!                 _rl_last_c_pos += temp;
  	    }
  	}
***************
*** 1608,1613 ****
--- 1622,1639 ----
  	  if (temp > 0)
  	    {
+ 	      /* If nfd begins at the prompt, or before the invisible
+ 		 characters in the prompt, we need to adjust _rl_last_c_pos
+ 		 in a multibyte locale to account for the wrap offset and
+ 		 set cpos_adjusted accordingly. */
  	      _rl_output_some_chars (nfd, temp);
  	      _rl_last_c_pos += col_temp;		/* XXX */
+ 	      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+ 		{
+ 		  if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
+ 		    {
+ 		      _rl_last_c_pos -= wrap_offset;
+ 		      cpos_adjusted = 1;
+ 		    }
+ 		}
  	    }
  	  lendiff = (oe - old) - (ne - new);


--- NEW FILE readline52-005 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-005

Bug-Reported-by:        Thomas Loeber <ifp at loeber1.de>
Bug-Reference-ID:       <200703082223.08919.ifp at loeber1.de>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00036.html

Bug-Description:

When rl_read_key returns -1, indicating that readline's controlling terminal
has been invalidated for some reason (e.g., receiving a SIGHUP), the error
status was not reported correctly to the caller.  This could cause input
loops. 

Patch:

*** ../readline-5.2/complete.c	Fri Jul 28 11:35:49 2006
--- complete.c	Tue Mar 13 08:50:16 2007
***************
*** 429,433 ****
        if (c == 'n' || c == 'N' || c == RUBOUT)
  	return (0);
!       if (c == ABORT_CHAR)
  	_rl_abort_internal ();
        if (for_pager && (c == NEWLINE || c == RETURN))
--- 440,444 ----
        if (c == 'n' || c == 'N' || c == RUBOUT)
  	return (0);
!       if (c == ABORT_CHAR || c < 0)
  	_rl_abort_internal ();
        if (for_pager && (c == NEWLINE || c == RETURN))
*** ../readline-5.2/input.c	Wed Aug 16 15:15:16 2006
--- input.c	Wed May  2 16:07:59 2007
***************
*** 514,518 ****
       int size;
  {
!   int mb_len = 0;
    size_t mbchar_bytes_length;
    wchar_t wc;
--- 522,526 ----
       int size;
  {
!   int mb_len, c;
    size_t mbchar_bytes_length;
    wchar_t wc;
***************
*** 521,531 ****
    memset(&ps, 0, sizeof (mbstate_t));
    memset(&ps_back, 0, sizeof (mbstate_t));
!   
    while (mb_len < size)
      {
        RL_SETSTATE(RL_STATE_MOREINPUT);
!       mbchar[mb_len++] = rl_read_key ();
        RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
        mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
        if (mbchar_bytes_length == (size_t)(-1))
--- 529,545 ----
    memset(&ps, 0, sizeof (mbstate_t));
    memset(&ps_back, 0, sizeof (mbstate_t));
! 
!   mb_len = 0;  
    while (mb_len < size)
      {
        RL_SETSTATE(RL_STATE_MOREINPUT);
!       c = rl_read_key ();
        RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
+       if (c < 0)
+ 	break;
+ 
+       mbchar[mb_len++] = c;
+ 
        mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
        if (mbchar_bytes_length == (size_t)(-1))
***************
*** 565,569 ****
    c = first;
    memset (mb, 0, mlen);
!   for (i = 0; i < mlen; i++)
      {
        mb[i] = (char)c;
--- 579,583 ----
    c = first;
    memset (mb, 0, mlen);
!   for (i = 0; c >= 0 && i < mlen; i++)
      {
        mb[i] = (char)c;
*** ../readline-5.2/isearch.c	Mon Dec 26 17:18:53 2005
--- isearch.c	Fri Mar  9 14:30:59 2007
***************
*** 328,333 ****
  
    f = (rl_command_func_t *)NULL;
!  
!  /* Translate the keys we do something with to opcodes. */
    if (c >= 0 && _rl_keymap[c].type == ISFUNC)
      {
--- 328,340 ----
  
    f = (rl_command_func_t *)NULL;
! 
!   if (c < 0)
!     {
!       cxt->sflags |= SF_FAILED;
!       cxt->history_pos = cxt->last_found_line;
!       return -1;
!     }
! 
!   /* Translate the keys we do something with to opcodes. */
    if (c >= 0 && _rl_keymap[c].type == ISFUNC)
      {
*** ../readline-5.2/misc.c	Mon Dec 26 17:20:46 2005
--- misc.c	Fri Mar  9 14:44:11 2007
***************
*** 147,150 ****
--- 147,152 ----
  	  rl_clear_message ();
  	  RL_UNSETSTATE(RL_STATE_NUMERICARG);
+ 	  if (key < 0)
+ 	    return -1;
  	  return (_rl_dispatch (key, _rl_keymap));
  	}
*** ../readline-5.2/readline.c	Wed Aug 16 15:00:36 2006
--- readline.c	Fri Mar  9 14:47:24 2007
***************
*** 646,649 ****
--- 669,677 ----
      {
        nkey = _rl_subseq_getchar (cxt->okey);
+       if (nkey < 0)
+ 	{
+ 	  _rl_abort_internal ();
+ 	  return -1;
+ 	}
        r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
        cxt->flags |= KSEQ_DISPATCHED;
*** ../readline-5.2/text.c	Fri Jul 28 11:55:27 2006
--- text.c	Sun Mar 25 13:41:38 2007
***************
*** 858,861 ****
--- 864,870 ----
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
+   if (c < 0)
+     return -1;
+ 
  #if defined (HANDLE_SIGNALS)
    if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
***************
*** 1521,1524 ****
--- 1530,1536 ----
    mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX);
  
+   if (mb_len <= 0)
+     return -1;
+ 
    if (count < 0)
      return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
***************
*** 1537,1540 ****
--- 1549,1555 ----
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
+   if (c < 0)
+     return -1;
+ 
    if (count < 0)
      return (_rl_char_search_internal (-count, bdir, c));
*** ../readline-5.2/vi_mode.c	Sat Jul 29 16:42:28 2006
--- vi_mode.c	Fri Mar  9 15:02:11 2007
***************
*** 887,890 ****
--- 887,897 ----
    c = rl_read_key ();
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ 
+   if (c < 0)
+     {
+       *nextkey = 0;
+       return -1;
+     }
+ 
    *nextkey = c;
  
***************
*** 903,906 ****
--- 910,918 ----
  	  c = rl_read_key ();	/* real command */
  	  RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ 	  if (c < 0)
+ 	    {
+ 	      *nextkey = 0;
+ 	      return -1;
+ 	    }
  	  *nextkey = c;
  	}
***************
*** 1225,1236 ****
       _rl_callback_generic_arg *data;
  {
  #if defined (HANDLE_MULTIBYTE)
!   _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
  #else
    RL_SETSTATE(RL_STATE_MOREINPUT);
!   _rl_vi_last_search_char = rl_read_key ();
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  #endif
  
    _rl_callback_func = 0;
    _rl_want_redisplay = 1;
--- 1243,1262 ----
       _rl_callback_generic_arg *data;
  {
+   int c;
  #if defined (HANDLE_MULTIBYTE)
!   c = _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
  #else
    RL_SETSTATE(RL_STATE_MOREINPUT);
!   c = rl_read_key ();
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  #endif
  
+   if (c <= 0)
+     return -1;
+ 
+ #if !defined (HANDLE_MULTIBYTE)
+   _rl_vi_last_search_char = c;
+ #endif
+ 
    _rl_callback_func = 0;
    _rl_want_redisplay = 1;
***************
*** 1248,1251 ****
--- 1274,1278 ----
       int count, key;
  {
+   int c;
  #if defined (HANDLE_MULTIBYTE)
    static char *target;
***************
*** 1294,1302 ****
  	{
  #if defined (HANDLE_MULTIBYTE)
! 	  _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
  #else
  	  RL_SETSTATE(RL_STATE_MOREINPUT);
! 	  _rl_vi_last_search_char = rl_read_key ();
  	  RL_UNSETSTATE(RL_STATE_MOREINPUT);
  #endif
  	}
--- 1321,1335 ----
  	{
  #if defined (HANDLE_MULTIBYTE)
! 	  c = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
! 	  if (c <= 0)
! 	    return -1;
! 	  _rl_vi_last_search_mblen = c;
  #else
  	  RL_SETSTATE(RL_STATE_MOREINPUT);
! 	  c = rl_read_key ();
  	  RL_UNSETSTATE(RL_STATE_MOREINPUT);
+ 	  if (c < 0)
+ 	    return -1;
+ 	  _rl_vi_last_search_char = c;
  #endif
  	}
***************
*** 1468,1471 ****
--- 1501,1507 ----
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
+   if (c < 0)
+     return -1;
+ 
  #if defined (HANDLE_MULTIBYTE)
    if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
***************
*** 1486,1489 ****
--- 1522,1528 ----
    _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
  
+   if (c < 0)
+     return -1;
+ 
    _rl_callback_func = 0;
    _rl_want_redisplay = 1;
***************
*** 1517,1520 ****
--- 1556,1562 ----
      _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
  
+   if (c < 0)
+     return -1;
+ 
    return (_rl_vi_change_char (count, c, mb));
  }
***************
*** 1651,1655 ****
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
!   if (ch < 'a' || ch > 'z')
      {
        rl_ding ();
--- 1693,1697 ----
    RL_UNSETSTATE(RL_STATE_MOREINPUT);
  
!   if (ch < 0 || ch < 'a' || ch > 'z')	/* make test against 0 explicit */
      {
        rl_ding ();
***************
*** 1703,1707 ****
        return 0;
      }
!   else if (ch < 'a' || ch > 'z')
      {
        rl_ding ();
--- 1745,1749 ----
        return 0;
      }
!   else if (ch < 0 || ch < 'a' || ch > 'z')	/* make test against 0 explicit */
      {
        rl_ding ();


--- NEW FILE readline52-006 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-006

Bug-Reported-by:        Peter Volkov <torre_cremata at mail.ru>
Bug-Reference-ID:       <1178376645.9063.25.camel at localhost>
Bug-Reference-URL:      http://bugs.gentoo.org/177095

Bug-Description:

The readline display code miscalculated the screen position when performing
a redisplay in which the new text occupies more screen space that the old,
but takes fewer bytes to do so (e.g., when replacing a shorter string
containing multibyte characters with a longer one containing only ASCII).

Patch:

*** ../readline-5.2/display.c	Thu Apr 26 11:38:22 2007
--- display.c	Thu Jul 12 23:10:10 2007
***************
*** 1519,1527 ****
        /* Non-zero if we're increasing the number of lines. */
        int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
        /* Sometimes it is cheaper to print the characters rather than
  	 use the terminal's capabilities.  If we're growing the number
  	 of lines, make sure we actually cause the new line to wrap
  	 around on auto-wrapping terminals. */
!       if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
  	{
  	  /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
--- 1568,1596 ----
        /* Non-zero if we're increasing the number of lines. */
        int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
+       /* If col_lendiff is > 0, implying that the new string takes up more
+ 	 screen real estate than the old, but lendiff is < 0, meaning that it
+ 	 takes fewer bytes, we need to just output the characters starting
+ 	 from the first difference.  These will overwrite what is on the
+ 	 display, so there's no reason to do a smart update.  This can really
+ 	 only happen in a multibyte environment. */
+       if (lendiff < 0)
+ 	{
+ 	  _rl_output_some_chars (nfd, temp);
+ 	  _rl_last_c_pos += _rl_col_width (nfd, 0, 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;
+ 	}
        /* Sometimes it is cheaper to print the characters rather than
  	 use the terminal's capabilities.  If we're growing the number
  	 of lines, make sure we actually cause the new line to wrap
  	 around on auto-wrapping terminals. */
!       else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
  	{
  	  /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and


--- NEW FILE readline52-007 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-007

Bug-Reported-by:        Tom Bjorkholm <tom.bjorkholm at ericsson.com>
Bug-Reference-ID:       <AEA1A32F001C6B4F98614B5B80D7647D01C075E9 at esealmw115.eemea.ericsson.se>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-readline/2007-04/msg00004.html


Bug-Description:

An off-by-one error in readline's input buffering caused readline to drop
each 511th character of buffered input (e.g., when pasting a large amount
of data into a terminal window).

Patch:

*** ../readline-5.2/input.c	Wed Aug 16 15:15:16 2006
--- input.c	Tue Jul 17 09:24:21 2007
***************
*** 134,139 ****
  
    *key = ibuffer[pop_index++];
! 
    if (pop_index >= ibuffer_len)
      pop_index = 0;
  
--- 134,142 ----
  
    *key = ibuffer[pop_index++];
! #if 0
    if (pop_index >= ibuffer_len)
+ #else
+   if (pop_index > ibuffer_len)
+ #endif
      pop_index = 0;
  
***************
*** 251,255 ****
  	{
  	  k = (*rl_getc_function) (rl_instream);
! 	  rl_stuff_char (k);
  	  if (k == NEWLINE || k == RETURN)
  	    break;
--- 254,259 ----
  	{
  	  k = (*rl_getc_function) (rl_instream);
! 	  if (rl_stuff_char (k) == 0)
! 	    break;			/* some problem; no more room */
  	  if (k == NEWLINE || k == RETURN)
  	    break;
***************
*** 374,378 ****
--- 378,386 ----
      }
    ibuffer[push_index++] = key;
+ #if 0
    if (push_index >= ibuffer_len)
+ #else
+   if (push_index > ibuffer_len)
+ #endif
      push_index = 0;
  


--- NEW FILE readline52-008 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-008

Bug-Reported-by:	dAniel hAhler <ubuntu at thequod.de>
Bug-Reference-ID:	<4702ED8A.5000503 at 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


--- NEW FILE readline52-009 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-009

Bug-Reported-by:	dAniel hAhler <ubuntu at thequod.de>
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;


--- NEW FILE readline52-010 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-010

Bug-Reported-by:	Miroslav Lichvar <mlichvar at redhat.com>
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;
  	    }


--- NEW FILE readline52-011 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-011

Bug-Reported-by:	Uwe Doering <gemini at geminix.org>
Bug-Reference-ID:	<46F3DD72.2090801 at 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);


--- NEW FILE readline52-013 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-013

Bug-Reported-by:	slinkp <stuff at slinkp.com>
Bug-Reference-ID:	<da52a26a-9f38-4861-a918-14d3482b539d at c65g2000hsa.googlegroups.com>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2008-05/msg00085.html

Bug-Description:

The presence of invisible characters in a prompt longer than the screenwidth
with invisible characters on the first and last prompt lines caused readline
to place the cursor in the wrong physical location.

Patch:

*** ../readline-5.2-patched/display.c	2007-12-14 21:12:40.000000000 -0500
--- display.c	2008-10-23 09:39:46.000000000 -0400
***************
*** 911,914 ****
--- 944,951 ----
  	     OFFSET (which has already been calculated above).  */
  
+ #define INVIS_FIRST()	(prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
+ #define WRAP_OFFSET(line, offset)  ((line == 0) \
+ 					? (offset ? INVIS_FIRST() : 0) \
+ 					: ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
  #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
  #define VIS_LLEN(l)	((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
***************
*** 945,949 ****
  		  _rl_last_c_pos > wrap_offset &&
  		  o_cpos < prompt_last_invisible)
! 		_rl_last_c_pos -= wrap_offset;
  		  
  	      /* If this is the line with the prompt, we might need to
--- 982,992 ----
  		  _rl_last_c_pos > wrap_offset &&
  		  o_cpos < prompt_last_invisible)
! 		_rl_last_c_pos -= prompt_invis_chars_first_line;	/* XXX - was wrap_offset */
! 	      else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth &&
! 			(MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
! 			cpos_adjusted == 0 &&
! 			_rl_last_c_pos != o_cpos &&
! 			_rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line))
! 		_rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
  		  
  	      /* If this is the line with the prompt, we might need to
***************
*** 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;
--- 1264,1268 ----
  {
    register char *ofd, *ols, *oe, *nfd, *nls, *ne;
!   int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
    int current_invis_chars;
    int col_lendiff, col_temp;
***************
*** 1221,1225 ****
      temp = _rl_last_c_pos;
    else
!     temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
    if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
  	&& _rl_last_v_pos == current_line - 1)
--- 1280,1284 ----
      temp = _rl_last_c_pos;
    else
!     temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
    if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
  	&& _rl_last_v_pos == current_line - 1)
***************
*** 1587,1599 ****
  	    {
  	      _rl_output_some_chars (nfd + lendiff, temp - lendiff);
- #if 1
  	     /* XXX -- this bears closer inspection.  Fixes a redisplay bug
  		reported against bash-3.0-alpha by Andreas Schwab involving
  		multibyte characters and prompt strings with invisible
  		characters, but was previously disabled. */
! 	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
! #else
! 	      _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
! #endif
  	    }
  	}
--- 1648,1660 ----
  	    {
  	      _rl_output_some_chars (nfd + lendiff, temp - lendiff);
  	     /* XXX -- this bears closer inspection.  Fixes a redisplay bug
  		reported against bash-3.0-alpha by Andreas Schwab involving
  		multibyte characters and prompt strings with invisible
  		characters, but was previously disabled. */
! 	      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
! 		twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
! 	      else
! 		twidth = temp - lendiff;
! 	      _rl_last_c_pos += twidth;
  	    }
  	}
***************
*** 1789,1793 ****
    int cpos, dpos;		/* current and desired cursor positions */
  
!   woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
    cpos = _rl_last_c_pos;
  #if defined (HANDLE_MULTIBYTE)
--- 1850,1854 ----
    int cpos, dpos;		/* current and desired cursor positions */
  
!   woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
    cpos = _rl_last_c_pos;
  #if defined (HANDLE_MULTIBYTE)
***************
*** 1803,1807 ****
  	 prompt string, since they're both buffer indices and DPOS is a
  	 desired display position. */
!       if (new > prompt_last_invisible)		/* XXX - don't use woff here */
  	{
  	  dpos -= woff;
--- 1864,1872 ----
  	 prompt string, since they're both buffer indices and DPOS is a
  	 desired display position. */
!       if ((new > prompt_last_invisible) ||		/* XXX - don't use woff here */
! 	  (prompt_physical_chars > _rl_screenwidth &&
! 	   _rl_last_v_pos == prompt_last_screen_line &&
! 	   wrap_offset != woff &&
! 	   new > (prompt_last_invisible-_rl_screenwidth-wrap_offset)))
  	{
  	  dpos -= woff;


--- NEW FILE readline52-014 ---
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 5.2
Patch-ID: readline52-014

Bug-Reported-by:	Len Lattanzi <llattanzi at apple.com>
Bug-Reference-ID:	<52B1297F-6675-45CC-B63E-24745337D006 at apple.com>
Bug-Reference-URL:

Bug-Description:

On systems where mbrtowc() returns -2 when passed a length argument with
value 0, when using a multibyte locale, Readline's emacs-mode forward-char
at the end of a line will leave the point beyond the end of the line.

Patch:

*** ../readline-5.2-patched/mbutil.c	2009-05-29 23:09:26.000000000 -0400
--- mbutil.c	2009-05-29 23:10:12.000000000 -0400
***************
*** 78,82 ****
       int seed, count, find_non_zero;
  {
!   size_t tmp;
    mbstate_t ps;
    int point;
--- 78,82 ----
       int seed, count, find_non_zero;
  {
!   size_t tmp, len;
    mbstate_t ps;
    int point;
***************
*** 99,103 ****
    while (count > 0)  
      {
!       tmp = mbrtowc (&wc, string+point, strlen(string + point), &ps);
        if (MB_INVALIDCH ((size_t)tmp))
  	{
--- 99,106 ----
    while (count > 0)  
      {
!       len = strlen (string + point);
!       if (len == 0)
! 	break;
!       tmp = mbrtowc (&wc, string+point, len, &ps);
        if (MB_INVALIDCH ((size_t)tmp))
  	{


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/compat-readline5/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	14 Jul 2009 04:39:31 -0000	1.1
+++ .cvsignore	14 Jul 2009 11:49:16 -0000	1.2
@@ -0,0 +1 @@
+readline-5.2.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/compat-readline5/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	14 Jul 2009 04:39:31 -0000	1.1
+++ sources	14 Jul 2009 11:49:16 -0000	1.2
@@ -0,0 +1 @@
+e39331f32ad14009b9ff49cc10c5e751  readline-5.2.tar.gz




More information about the fedora-extras-commits mailing list