aboutsummaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2020-02-07 14:56:45 -0500
committerTom Tromey <tom@tromey.com>2020-06-30 15:10:46 -0600
commitfca1f7036a4e9444e790e32e6206d80ef4a0db97 (patch)
treebec86b3604ea3b32601cb03ddd2f2c556ea8d7ca /readline
parent8cfb541ad1edfcc21b28eeb767e66b1001b0a84c (diff)
downloadgdb-fca1f7036a4e9444e790e32e6206d80ef4a0db97.zip
gdb-fca1f7036a4e9444e790e32e6206d80ef4a0db97.tar.gz
gdb-fca1f7036a4e9444e790e32e6206d80ef4a0db97.tar.bz2
fix problems moving back beyond start of history
Diffstat (limited to 'readline')
-rw-r--r--readline/readline/misc.c5
-rw-r--r--readline/readline/patchlevel2
2 files changed, 5 insertions, 2 deletions
diff --git a/readline/readline/misc.c b/readline/readline/misc.c
index 64b1457..42005b0 100644
--- a/readline/readline/misc.c
+++ b/readline/readline/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/readline/readline/patchlevel b/readline/readline/patchlevel
index fdf4740..7cbda82 100644
--- a/readline/readline/patchlevel
+++ b/readline/readline/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-1
+2