def rl_get_previous_history(count, key)
if (count < 0)
return (rl_get_next_history(-count, key))
end
if (count == 0)
return 0
end
if (@_rl_history_saved_point == -1 && (@rl_point!=0 || @rl_end!=0))
@_rl_history_saved_point = (@rl_point == @rl_end) ? -1 : @rl_point
end
rl_maybe_save_line()
rl_maybe_replace_line()
temp = old_temp = nil
while (count>0)
temp = previous_history()
if temp.nil?
break
end
old_temp = temp
count -= 1
end
if (temp.nil? && old_temp)
temp = old_temp
end
if temp.nil?
rl_ding()
else
rl_replace_from_history(temp, 0)
_rl_history_set_point()
end
0
end