run-command.c: fix broken list iteration in clear_child_for_cleanup
commitbdee397d7c2345d467548ef9446a2a63b72c5449
authorDavid Gould <david@optimisefitness.com>
Tue, 11 Sep 2012 14:32:47 +0000 (11 15:32 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Sep 2012 17:30:31 +0000 (11 10:30 -0700)
tree71a4db98c94c786f0edb06839cc4c9b5cab40d98
parentafe19ff7b55129d988e421ae1e0df4ec9659787a
run-command.c: fix broken list iteration in clear_child_for_cleanup

Iterate through children_to_clean using 'next' fields but with an
extra level of indirection. This allows us to update the chain when
we remove a child and saves us managing several variables around
the loop mechanism.

Signed-off-by: David Gould <david@optimisefitness.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c