aboutsummaryrefslogtreecommitdiff
path: root/readline/undo.c
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2015-07-25 15:41:05 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2015-07-25 15:57:00 -0400
commit5836a818eccb180d75c92ce4c861abb6fe8dec23 (patch)
tree624044ca5df5a6c192e47933a735ab4fe9aaea71 /readline/undo.c
parentb8cc7b2e9afab37eb9a7cff0d3ae4ebbcf7d494f (diff)
downloadgdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.zip
gdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.tar.gz
gdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.tar.bz2
Revert "Sync readline/ to version 7.0 alpha"
This reverts commit b558ff043d41ba8d17a82f5f9ae5f9dade66160e. This reverts commit 4a11f2065906976675808364ddbd1c0f77eea41f. The initial import commit failed to retain local changes made to readline's configure.in (and the commit message erroneously stated that there were no local changes that needed to be reapplied). Also the import caused a couple of build errors and a scattering of testsuite regressions throughout many arches. It's probably better to start over with this import, hopefully more carefully next time.
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);