applied patch readline52-007
authorAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 14:45:33 +0000 (06:45 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 14:45:33 +0000 (06:45 -0800)
input.c

diff --git a/input.c b/input.c
index 9660ff1..b91548e 100644 (file)
--- a/input.c
+++ b/input.c
@@ -133,8 +133,11 @@ rl_get_char (key)
     return (0);
 
   *key = ibuffer[pop_index++];
-
+#if 0
   if (pop_index >= ibuffer_len)
+#else
+  if (pop_index > ibuffer_len)
+#endif
     pop_index = 0;
 
   return (1);
@@ -250,7 +253,8 @@ rl_gather_tyi ()
       while (chars_avail--)
        {
          k = (*rl_getc_function) (rl_instream);
-         rl_stuff_char (k);
+         if (rl_stuff_char (k) == 0)
+           break;                      /* some problem; no more room */
          if (k == NEWLINE || k == RETURN)
            break;
        }
@@ -373,7 +377,11 @@ rl_stuff_char (key)
       RL_SETSTATE (RL_STATE_INPUTPENDING);
     }
   ibuffer[push_index++] = key;
+#if 0
   if (push_index >= ibuffer_len)
+#else
+  if (push_index > ibuffer_len)
+#endif
     push_index = 0;
 
   return 1;