commit bash-20100225 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 21:55:02 -05:00
parent 4691dc6b2d
commit 644196275f
44 changed files with 8373 additions and 98 deletions
+34
View File
@@ -4639,6 +4639,40 @@ set_pipestatus_array (ps, nproc)
}
}
}
ARRAY *
save_pipestatus_array ()
{
SHELL_VAR *v;
ARRAY *a, *a2;
v = find_variable ("PIPESTATUS");
if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
return ((ARRAY *)NULL);
a = array_cell (v);
a2 = array_copy (array_cell (v));
return a2;
}
void
restore_pipestatus_array (a)
ARRAY *a;
{
SHELL_VAR *v;
ARRAY *a2;
v = find_variable ("PIPESTATUS");
/* XXX - should we still assign even if existing value is NULL? */
if (v == 0 || array_p (v) == 0 || array_cell (v) == 0)
return;
a2 = array_cell (v);
var_setarray (v, a);
array_dispose (a2);
}
#endif
void