1 Star 0 Fork 9

openeuler-embedded/readline

forked from src-openEuler/readline 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-problems-moving-back-beyond-start-of-history.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
From d063aa6a54e670adeaa9b71385394dbf8dc9ff63 Mon Sep 17 00:00:00 2001
From: Chet Ramey <[email protected]>
Date: Fri, 7 Feb 2020 14:56:45 -0500
Subject: [PATCH 2/4] fix problems moving back beyond start of history
---
misc.c | 5 ++++-
patchlevel | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/misc.c b/misc.c
index 64b1457..42005b0 100644
--- a/misc.c
+++ b/misc.c
@@ -576,6 +576,7 @@ int
rl_get_previous_history (int count, int key)
{
HIST_ENTRY *old_temp, *temp;
+ int had_saved_line;
if (count < 0)
return (rl_get_next_history (-count, key));
@@ -588,6 +589,7 @@ rl_get_previous_history (int count, int key)
_rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point;
/* If we don't have a line saved, then save this one. */
+ had_saved_line = _rl_saved_line_for_history != 0;
rl_maybe_save_line ();
/* If the current line has changed, save the changes. */
@@ -611,7 +613,8 @@ rl_get_previous_history (int count, int key)
if (temp == 0)
{
- rl_maybe_unsave_line ();
+ if (had_saved_line == 0)
+ _rl_free_saved_history_line ();
rl_ding ();
}
else
diff --git a/patchlevel b/patchlevel
index fdf4740..7cbda82 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-1
+2
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-embedded/readline.git
[email protected]:openeuler-embedded/readline.git
openeuler-embedded
readline
readline
openEuler-embedded

搜索帮助