aboutsummaryrefslogtreecommitdiff
path: root/readline/undo.c
diff options
context:
space:
mode:
Diffstat (limited to 'readline/undo.c')
-rw-r--r--readline/undo.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/readline/undo.c b/readline/undo.c
index e9369b1..eb042b2 100644
--- a/readline/undo.c
+++ b/readline/undo.c
@@ -1,7 +1,7 @@
/* readline.c -- a general facility for reading lines of input
with emacs style editing and completion. */
-/* Copyright (C) 1987-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -101,33 +101,23 @@ rl_add_undo (what, start, end, text)
rl_undo_list = temp;
}
-/* Free an UNDO_LIST */
+/* Free the existing undo list. */
void
-_rl_free_undo_list (ul)
- UNDO_LIST *ul;
+rl_free_undo_list ()
{
- UNDO_LIST *release;
+ UNDO_LIST *release, *orig_list;
- while (ul)
+ orig_list = rl_undo_list;
+ while (rl_undo_list)
{
- release = ul;
- ul = ul->next;
+ release = rl_undo_list;
+ rl_undo_list = rl_undo_list->next;
if (release->what == UNDO_DELETE)
xfree (release->text);
xfree (release);
}
-}
-
-/* Free the existing undo list. */
-void
-rl_free_undo_list ()
-{
- UNDO_LIST *release, *orig_list;
-
- orig_list = rl_undo_list;
- _rl_free_undo_list (rl_undo_list);
rl_undo_list = (UNDO_LIST *)NULL;
replace_history_data (-1, (histdata_t *)orig_list, (histdata_t *)NULL);
}
@@ -178,7 +168,6 @@ rl_do_undo ()
{
UNDO_LIST *release;
int waiting_for_begin, start, end;
- HIST_ENTRY *cur, *temp;
#define TRANS(i) ((i) == -1 ? rl_point : ((i) == -2 ? rl_end : (i)))
@@ -233,18 +222,6 @@ rl_do_undo ()
release = rl_undo_list;
rl_undo_list = rl_undo_list->next;
-
- /* If we are editing a history entry, make sure the change is replicated
- in the history entry's line */
- cur = current_history ();
- if (cur && cur->data && (UNDO_LIST *)cur->data == release)
- {
- temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list);
- xfree (temp->line);
- FREE (temp->timestamp);
- xfree (temp);
- }
-
replace_history_data (-1, (histdata_t *)release, (histdata_t *)rl_undo_list);
xfree (release);