commit bash-20101015 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 22:08:08 -05:00
parent aad3dfa27a
commit 048b249ea3
33 changed files with 843 additions and 122 deletions
+29 -1
View File
@@ -240,18 +240,24 @@ unwind_frame_discard_internal (tag, ignore)
char *tag, *ignore;
{
UNWIND_ELT *elt;
int found;
found = 0;
while (elt = unwind_protect_list)
{
unwind_protect_list = unwind_protect_list->head.next;
if (elt->head.cleanup == 0 && (STREQ (elt->arg.v, tag)))
{
uwpfree (elt);
found = 1;
break;
}
else
uwpfree (elt);
}
if (found == 0)
internal_warning ("unwind_frame_discard: %s: frame not found", tag);
}
/* Restore the value of a variable, based on the contents of SV.
@@ -269,17 +275,20 @@ unwind_frame_run_internal (tag, ignore)
char *tag, *ignore;
{
UNWIND_ELT *elt;
int found;
found = 0;
while (elt = unwind_protect_list)
{
unwind_protect_list = elt->head.next;
/* If tag, then compare. */
if (!elt->head.cleanup)
if (elt->head.cleanup == 0)
{
if (tag && STREQ (elt->arg.v, tag))
{
uwpfree (elt);
found = 1;
break;
}
}
@@ -293,6 +302,8 @@ unwind_frame_run_internal (tag, ignore)
uwpfree (elt);
}
if (tag && found == 0)
internal_warning ("unwind_frame_run: %s: frame not found", tag);
}
static void
@@ -324,3 +335,20 @@ unwind_protect_mem (var, size)
{
without_interrupts (unwind_protect_mem_internal, var, (char *) &size);
}
#if defined (DEBUG)
void
print_unwind_protect_tags ()
{
UNWIND_ELT *elt;
elt = unwind_protect_list;
while (elt)
{
unwind_protect_list = unwind_protect_list->head.next;
if (elt->head.cleanup == 0)
fprintf(stderr, "tag: %s\n", elt->arg.v);
elt = unwind_protect_list;
}
}
#endif