***************
*** 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)
      {
