Index: BOOK/final-system/common/readline.xml
===================================================================
--- BOOK/final-system/common/readline.xml	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/final-system/common/readline.xml	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -30,4 +30,11 @@
 
 <screen os="p2"><userinput>patch -Np1 -i ../&readline-branch_update-patch;</userinput></screen>
+
+<para os="s1">Reinstalling Readline moves the old libraries to
+    &lt;libraryname&gt; and a linking bug may occur in 
+    <command>ldconfig</command>. Prevent this with the following seds:</para>
+
+<screen os="s2"><userinput>sed -i '/MV.*old/d' Makefile.in
+sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen>
 
     <para os="a">Prepare Readline for compilation:</para>
Index: BOOK/final-system/multilib/readline-64bit.xml
===================================================================
--- BOOK/final-system/multilib/readline-64bit.xml	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/final-system/multilib/readline-64bit.xml	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -29,4 +29,12 @@
     href="readline.xml"
     xpointer="xpointer(//*[@os='p2'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s2'])"/>
 
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
Index: BOOK/final-system/multilib/readline-n32.xml
===================================================================
--- BOOK/final-system/multilib/readline-n32.xml	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/final-system/multilib/readline-n32.xml	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -30,4 +30,12 @@
     href="readline.xml"
     xpointer="xpointer(//*[@os='p2'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s2'])"/>
 
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
Index: BOOK/final-system/multilib/readline.xml
===================================================================
--- BOOK/final-system/multilib/readline.xml	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/final-system/multilib/readline.xml	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -30,4 +30,12 @@
     href="../common/readline.xml"
     xpointer="xpointer(//*[@os='p2'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/readline.xml"
+    xpointer="xpointer(//*[@os='s2'])"/>
 
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
Index: BOOK/introduction/common/changelog.xml
===================================================================
--- BOOK/introduction/common/changelog.xml	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/introduction/common/changelog.xml	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -37,4 +37,14 @@
 -->
     <listitem>
+      <para>04 May 2017</para>
+      <itemizedlist>
+        <listitem>
+          <para>[William Harrington] - Upgrade Readline to 7.0. Fixes
+          ticket <ulink url="&clfs-ticket-root;1105">#1086.</ulink></para> 
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+    <listitem>
       <para>03 May 2017</para>
       <itemizedlist>
Index: BOOK/packages.ent
===================================================================
--- BOOK/packages.ent	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/packages.ent	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -392,8 +392,8 @@
 <!ENTITY psmisc-home "http://psmisc.sourceforge.net">
 
-<!ENTITY readline-version "6.3">
-<!ENTITY readline-size "2,469 KB">
+<!ENTITY readline-version "7.0">
+<!ENTITY readline-size "2,910 KB">
 <!ENTITY readline-url "&gnu;readline/readline-&readline-version;.tar.gz">
-<!ENTITY readline-md5 "33c8fb279e981274f485fd91da77e94a">
+<!ENTITY readline-md5 "205b03a87fc83dab653b628c59b9fc91">
 <!ENTITY readline-home "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html">
 <!ENTITY rsyslog-version "6.4.2">
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ BOOK/patches.ent	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -68,7 +68,7 @@
 -->
 
-<!ENTITY readline-branch_update-patch "readline-&readline-version;-branch_update-4.patch">
-<!ENTITY readline-branch_update-patch-md5 "bb8d37fd00abc74a81563ebfcf64af4c">
-<!ENTITY readline-branch_update-patch-size "5.733 KB">
+<!ENTITY readline-branch_update-patch "readline-&readline-version;-branch_update-1.patch">
+<!ENTITY readline-branch_update-patch-md5 "8b429202ce52362ae927f36a48461c23">
+<!ENTITY readline-branch_update-patch-size "3.049 KB">
 
 <!ENTITY sysvinit-tools_updates-patch "sysvinit-&sysvinit-version;-tools_updates-1.patch">
Index: tches/readline-6.3-branch_update-4.patch
===================================================================
--- patches/readline-6.3-branch_update-4.patch	(revision ae4e90c785c5b83a168bc4822200e1bd598cf0fd)
+++ 	(revision )
@@ -1,161 +1,0 @@
-Submitted By: William Harrington (kb0iic at cross-lfs dot org)
-Date: 09-26-2014
-Initial Package Version: 6.3
-Origin: Upstream
-Upstream Status: Applied
-Description: Contains all upstream patches up to 6.3-008
-
-diff -Naur readline-6.3.orig/display.c readline-6.3/display.c
---- readline-6.3.orig/display.c	2013-12-27 18:10:56.000000000 +0000
-+++ readline-6.3/display.c	2014-09-27 00:01:42.959231656 +0000
-@@ -1637,7 +1637,7 @@
-   /* If we are changing the number of invisible characters in a line, and
-      the spot of first difference is before the end of the invisible chars,
-      lendiff needs to be adjusted. */
--  if (current_line == 0 && !_rl_horizontal_scroll_mode &&
-+  if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
-       current_invis_chars != visible_wrap_offset)
-     {
-       if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
-@@ -1825,8 +1825,13 @@
- 	      else
- 		_rl_last_c_pos += bytes_to_insert;
- 
-+	      /* XXX - we only want to do this if we are at the end of the line
-+		 so we move there with _rl_move_cursor_relative */
- 	      if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
--		goto clear_rest_of_line;
-+		{
-+		  _rl_move_cursor_relative (ne-new, new);
-+		  goto clear_rest_of_line;
-+		}
- 	    }
- 	}
-       /* Otherwise, print over the existing material. */
-@@ -2677,7 +2682,8 @@
- {
-   if (_rl_echoing_p)
-     {
--      _rl_move_vert (_rl_vis_botlin);
-+      if (_rl_vis_botlin > 0)	/* minor optimization plus bug fix */
-+	_rl_move_vert (_rl_vis_botlin);
-       _rl_vis_botlin = 0;
-       fflush (rl_outstream);
-       rl_restart_output (1, 0);
-diff -Naur readline-6.3.orig/input.c readline-6.3/input.c
---- readline-6.3.orig/input.c	2014-01-10 20:07:08.000000000 +0000
-+++ readline-6.3/input.c	2014-09-27 00:01:42.962564981 +0000
-@@ -534,8 +534,16 @@
- 	return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
-       else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
- 	return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
-+      /* keyboard-generated signals of interest */
-       else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
-         RL_CHECK_SIGNALS ();
-+      /* non-keyboard-generated signals of interest */
-+      else if (_rl_caught_signal == SIGALRM
-+#if defined (SIGVTALRM)
-+		|| _rl_caught_signal == SIGVTALRM
-+#endif
-+	      )
-+        RL_CHECK_SIGNALS ();
- 
-       if (rl_signal_event_hook)
- 	(*rl_signal_event_hook) ();
-diff -Naur readline-6.3.orig/misc.c readline-6.3/misc.c
---- readline-6.3.orig/misc.c	2012-09-01 22:03:11.000000000 +0000
-+++ readline-6.3/misc.c	2014-09-27 00:01:42.965898306 +0000
-@@ -461,6 +461,7 @@
- 	    saved_undo_list = 0;
- 	  /* Set up rl_line_buffer and other variables from history entry */
- 	  rl_replace_from_history (entry, 0);	/* entry->line is now current */
-+	  entry->data = 0;			/* entry->data is now current undo list */
- 	  /* Undo all changes to this history entry */
- 	  while (rl_undo_list)
- 	    rl_do_undo ();
-@@ -468,7 +469,6 @@
- 	     the timestamp. */
- 	  FREE (entry->line);
- 	  entry->line = savestring (rl_line_buffer);
--	  entry->data = 0;
- 	}
-       entry = previous_history ();
-     }
-diff -Naur readline-6.3.orig/patchlevel readline-6.3/patchlevel
---- readline-6.3.orig/patchlevel	2013-11-15 13:11:11.000000000 +0000
-+++ readline-6.3/patchlevel	2014-09-27 00:01:42.965898306 +0000
-@@ -1,3 +1,3 @@
- # Do not edit -- exists only for use by patch
- 
--5
-+8
-diff -Naur readline-6.3.orig/readline.c readline-6.3/readline.c
---- readline-6.3.orig/readline.c	2013-10-28 18:58:06.000000000 +0000
-+++ readline-6.3/readline.c	2014-09-27 00:01:42.945898355 +0000
-@@ -744,7 +744,8 @@
-     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
- 
-   RL_CHECK_SIGNALS ();
--  if (r == 0)			/* success! */
-+  /* We only treat values < 0 specially to simulate recursion. */
-+  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0))	/* success! or failure! */
-     {
-       _rl_keyseq_chain_dispose ();
-       RL_UNSETSTATE (RL_STATE_MULTIKEY);
-@@ -964,7 +965,7 @@
- #if defined (VI_MODE)
-   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
-       key != ANYOTHERKEY &&
--      rl_key_sequence_length == 1 &&	/* XXX */
-+      _rl_dispatching_keymap == vi_movement_keymap &&
-       _rl_vi_textmod_command (key))
-     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
- #endif
-diff -Naur readline-6.3.orig/rltypedefs.h readline-6.3/rltypedefs.h
---- readline-6.3.orig/rltypedefs.h	2011-03-26 18:53:31.000000000 +0000
-+++ readline-6.3/rltypedefs.h	2014-09-27 00:01:42.955898330 +0000
-@@ -26,6 +26,25 @@
- extern "C" {
- #endif
- 
-+/* Old-style, attempt to mark as deprecated in some way people will notice. */
-+
-+#if !defined (_FUNCTION_DEF)
-+#  define _FUNCTION_DEF
-+
-+#if defined(__GNUC__) || defined(__clang__)
-+typedef int Function () __attribute__ ((deprecated));
-+typedef void VFunction () __attribute__ ((deprecated));
-+typedef char *CPFunction () __attribute__ ((deprecated));
-+typedef char **CPPFunction () __attribute__ ((deprecated));
-+#else
-+typedef int Function ();
-+typedef void VFunction ();
-+typedef char *CPFunction ();
-+typedef char **CPPFunction ();
-+#endif
-+
-+#endif /* _FUNCTION_DEF */
-+
- /* New style. */
- 
- #if !defined (_RL_FUNCTION_TYPEDEF)
-diff -Naur readline-6.3.orig/util.c readline-6.3/util.c
---- readline-6.3.orig/util.c	2013-09-02 17:36:12.000000000 +0000
-+++ readline-6.3/util.c	2014-09-27 00:01:42.949231680 +0000
-@@ -476,6 +476,7 @@
-   return (strcpy ((char *)xmalloc (1 + (int)strlen (s)), (s)));
- }
- 
-+#if defined (DEBUG)
- #if defined (USE_VARARGS)
- static FILE *_rl_tracefp;
- 
-@@ -538,6 +539,7 @@
-   _rl_tracefp = fp;
- }
- #endif
-+#endif /* DEBUG */
- 
- 
- #if HAVE_DECL_AUDIT_USER_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT)
Index: patches/readline-7.0-branch_update-1.patch
===================================================================
--- patches/readline-7.0-branch_update-1.patch	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
+++ patches/readline-7.0-branch_update-1.patch	(revision b25291539cb34a8ea800d40820b4b29bc221ed39)
@@ -0,0 +1,96 @@
+Submitted By: William Harrington (kb0iic at cross-lfs dot org)
+Date: 05-04-2017
+Initial Package Version: 7.0
+Origin: Upstream
+Upstream Status: Applied
+Description: Contains all upstream patches up to 7.0-003
+
+diff -Naur readline-7.0.orig/history.c readline-7.0/history.c
+--- readline-7.0.orig/history.c	2015-12-28 18:50:31.000000000 +0000
++++ readline-7.0/history.c	2017-05-04 22:19:51.586694240 +0000
+@@ -57,6 +57,8 @@
+ /* How big to make the_history when we first allocate it. */
+ #define DEFAULT_HISTORY_INITIAL_SIZE	502
+ 
++#define MAX_HISTORY_INITIAL_SIZE	8192
++
+ /* The number of slots to increase the_history by. */
+ #define DEFAULT_HISTORY_GROW_SIZE 50
+ 
+@@ -277,6 +279,7 @@
+      const char *string;
+ {
+   HIST_ENTRY *temp;
++  int new_length;
+ 
+   if (history_stifled && (history_length == history_max_entries))
+     {
+@@ -293,13 +296,9 @@
+ 
+       /* Copy the rest of the entries, moving down one slot.  Copy includes
+ 	 trailing NULL.  */
+-#if 0
+-      for (i = 0; i < history_length; i++)
+-	the_history[i] = the_history[i + 1];
+-#else
+       memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
+-#endif
+ 
++      new_length = history_length;
+       history_base++;
+     }
+   else
+@@ -307,11 +306,13 @@
+       if (history_size == 0)
+ 	{
+ 	  if (history_stifled && history_max_entries > 0)
+-	    history_size = history_max_entries + 2;
++	    history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
++				? MAX_HISTORY_INITIAL_SIZE
++				: history_max_entries + 2;
+ 	  else
+ 	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+ 	  the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
+-	  history_length = 1;
++	  new_length = 1;
+ 	}
+       else
+ 	{
+@@ -321,14 +322,15 @@
+ 	      the_history = (HIST_ENTRY **)
+ 		xrealloc (the_history, history_size * sizeof (HIST_ENTRY *));
+ 	    }
+-	  history_length++;
++	  new_length = history_length + 1;
+ 	}
+     }
+ 
+   temp = alloc_history_entry ((char *)string, hist_inittime ());
+ 
+-  the_history[history_length] = (HIST_ENTRY *)NULL;
+-  the_history[history_length - 1] = temp;
++  the_history[new_length] = (HIST_ENTRY *)NULL;
++  the_history[new_length - 1] = temp;
++  history_length = new_length;
+ }
+ 
+ /* Change the time stamp of the most recent history entry to STRING. */
+diff -Naur readline-7.0.orig/input.c readline-7.0/input.c
+--- readline-7.0.orig/input.c	2016-08-30 14:21:47.000000000 +0000
++++ readline-7.0/input.c	2017-05-04 22:19:51.587694257 +0000
+@@ -513,6 +513,7 @@
+       result = 0;
+ #if defined (HAVE_PSELECT)
+       sigemptyset (&empty_set);
++      sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &empty_set);
+       FD_ZERO (&readfds);
+       FD_SET (fileno (stream), &readfds);
+       result = pselect (fileno (stream) + 1, &readfds, NULL, NULL, NULL, &empty_set);
+diff -Naur readline-7.0.orig/patchlevel readline-7.0/patchlevel
+--- readline-7.0.orig/patchlevel	2015-10-02 11:25:03.000000000 +0000
++++ readline-7.0/patchlevel	2017-05-04 22:19:51.587694257 +0000
+@@ -1,3 +1,3 @@
+ # Do not edit -- exists only for use by patch
+ 
+-0
++3
