Blame readline6.3-upstream-patches1-6.patch

17014ee
From 549b257cc32325658360b2e349dfc9cadc33ff80 Mon Sep 17 00:00:00 2001
17014ee
From: Jan Chaloupka <jchaloup@redhat.com>
17014ee
Date: Mon, 21 Jul 2014 14:40:03 +0200
17014ee
Subject: [PATCH] upstream
17014ee
17014ee
---
17014ee
 display.c    | 10 ++++++++--
17014ee
 readline.c   |  6 ++++--
17014ee
 rltypedefs.h | 19 +++++++++++++++++++
17014ee
 util.c       |  3 ++-
17014ee
 4 files changed, 33 insertions(+), 5 deletions(-)
17014ee
17014ee
diff --git a/display.c b/display.c
17014ee
index 913e0da..10a7b81 100644
17014ee
--- a/display.c
17014ee
+++ b/display.c
17014ee
@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
17014ee
   /* If we are changing the number of invisible characters in a line, and
17014ee
      the spot of first difference is before the end of the invisible chars,
17014ee
      lendiff needs to be adjusted. */
17014ee
-  if (current_line == 0 && !_rl_horizontal_scroll_mode &&
17014ee
+  if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
17014ee
       current_invis_chars != visible_wrap_offset)
17014ee
     {
17014ee
       if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
17014ee
@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
17014ee
 	      else
17014ee
 		_rl_last_c_pos += bytes_to_insert;
17014ee
 
17014ee
+	      /* XXX - we only want to do this if we are at the end of the line
17014ee
++                so we move there with _rl_move_cursor_relative */
17014ee
 	      if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
17014ee
-		goto clear_rest_of_line;
17014ee
+		{
17014ee
+                  _rl_move_cursor_relative (ne-new, new);
17014ee
+                  goto clear_rest_of_line;
17014ee
+                }
17014ee
 	    }
17014ee
 	}
17014ee
       /* Otherwise, print over the existing material. */
17014ee
@@ -2677,6 +2682,7 @@ _rl_clean_up_for_exit ()
17014ee
 {
17014ee
   if (_rl_echoing_p)
17014ee
     {
17014ee
+      if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */
17014ee
       _rl_move_vert (_rl_vis_botlin);
17014ee
       _rl_vis_botlin = 0;
17014ee
       fflush (rl_outstream);
17014ee
diff --git a/readline.c b/readline.c
17014ee
index 03eefa6..684a589 100644
17014ee
--- a/readline.c
17014ee
+++ b/readline.c
17014ee
@@ -744,7 +744,9 @@ _rl_dispatch_callback (cxt)
17014ee
     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
17014ee
 
17014ee
   RL_CHECK_SIGNALS ();
17014ee
-  if (r == 0)			/* success! */
17014ee
+  /* We only treat values < 0 specially to simulate recursion. */
17014ee
+  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or 
17014ee
+failure! */
17014ee
     {
17014ee
       _rl_keyseq_chain_dispose ();
17014ee
       RL_UNSETSTATE (RL_STATE_MULTIKEY);
17014ee
@@ -964,7 +966,7 @@ _rl_dispatch_subseq (key, map, got_subseq)
17014ee
 #if defined (VI_MODE)
17014ee
   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
17014ee
       key != ANYOTHERKEY &&
17014ee
-      rl_key_sequence_length == 1 &&	/* XXX */
17014ee
+      _rl_dispatching_keymap == vi_movement_keymap &&
17014ee
       _rl_vi_textmod_command (key))
17014ee
     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
17014ee
 #endif
17014ee
diff --git a/rltypedefs.h b/rltypedefs.h
17014ee
index b113ee6..f9f5cd3 100644
17014ee
--- a/rltypedefs.h
17014ee
+++ b/rltypedefs.h
17014ee
@@ -26,6 +26,25 @@
17014ee
 extern "C" {
17014ee
 #endif
17014ee
 
17014ee
+/* Old-style, attempt to mark as deprecated in some way people will notice. */
17014ee
+
17014ee
+#if !defined (_FUNCTION_DEF)
17014ee
+#  define _FUNCTION_DEF
17014ee
+
17014ee
+#if defined(__GNUC__) || defined(__clang__)
17014ee
+typedef int Function () __attribute__ ((deprecated));
17014ee
+typedef void VFunction () __attribute__ ((deprecated));
17014ee
+typedef char *CPFunction () __attribute__ ((deprecated));
17014ee
+typedef char **CPPFunction () __attribute__ ((deprecated));
17014ee
+#else
17014ee
+typedef int Function ();
17014ee
+typedef void VFunction ();
17014ee
+typedef char *CPFunction ();
17014ee
+typedef char **CPPFunction ();
17014ee
+#endif
17014ee
+
17014ee
+#endif /* _FUNCTION_DEF */
17014ee
+
17014ee
 /* New style. */
17014ee
 
17014ee
 #if !defined (_RL_FUNCTION_TYPEDEF)
17014ee
diff --git a/util.c b/util.c
17014ee
index fa3a667..a8ab81a 100644
17014ee
--- a/util.c
17014ee
+++ b/util.c
17014ee
@@ -476,6 +476,7 @@ _rl_savestring (s)
17014ee
   return (strcpy ((char *)xmalloc (1 + (int)strlen (s)), (s)));
17014ee
 }
17014ee
 
17014ee
+#if defined (DEBUG)
17014ee
 #if defined (USE_VARARGS)
17014ee
 static FILE *_rl_tracefp;
17014ee
 
17014ee
@@ -538,7 +539,7 @@ _rl_settracefp (fp)
17014ee
   _rl_tracefp = fp;
17014ee
 }
17014ee
 #endif
17014ee
-
17014ee
+#endif /* DEBUG */
17014ee
 
17014ee
 #if HAVE_DECL_AUDIT_USER_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT)
17014ee
 #include <sys/socket.h>
17014ee
-- 
17014ee
1.9.3
17014ee