remove.c: don't use xmalloc; don't let obstack call exit on failure
commita5111af33ea6a5d27c3f7ab67afdb2a5884c38b6
authorJim Meyering <meyering@redhat.com>
Wed, 24 Sep 2008 08:27:35 +0000 (24 10:27 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 26 Sep 2008 22:10:08 +0000 (27 00:10 +0200)
tree1d24b81a2662dd08404c3776d570215516c7518c
parent1e3ebd660add628cfc135825dc801026a0cba80d
remove.c: don't use xmalloc; don't let obstack call exit on failure

(obstack_chunk_alloc, obstack_chunk_free): Don't define.
(top_dir): Param is no longer "const".
Use malloc, not xmalloc, and call longjmp upon failed malloc.
(obstack_init_minimal): New function.
(ds_init): Don't use xmalloc.  Instead, use caller-supplied buffer.
Use obstack_specify_allocation_with_arg, not obstack_init, so
that we control what happens upon allocation failure.
Arrange for ds_free not to free uninitialized if/when
any obstack_specify_allocation_with_arg allocation fails.
(ds_free): Don't free DS, now that it's no longer malloc'd.
(rm): Allocate DS on the stack.
Arrange to handle ds_init allocation failure.

step1
src/remove.c