summaryrefslogtreecommitdiff
path: root/Documentation/Makefile
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-05-15 04:33:40 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-05-15 09:49:10 -0700
commit5eb7f7ead8537420fde3eb344640096fc330bc16 (patch)
tree5803baf8635fdb7050b33aee83248167b4ac597c /Documentation/Makefile
parentrun-command: store an optional argv_array (diff)
downloadtgif-5eb7f7ead8537420fde3eb344640096fc330bc16.tar.xz
run_column_filter: use argv_array
We currently set up the argv array by hand in a fixed-size stack-local array. Using an argv array is more readable, as it handles buffer allocation us (not to mention makes it obvious we do not overflow the array). However, there's a more subtle benefit, too. We leave the function having run start_command (with the child_process in a static global), and then later run finish_command from another function. That means when we run finish_command, neither column_process.argv nor the memory it points to is valid any longer. Most of the time finish_command does not bother looking at argv, but it may if it encounters an error (e.g., waitpid failure or signal death). This is unusual, which is why nobody has noticed. But by using run-command's built-in argv_array, the memory ownership is handled for us automatically. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/Makefile')
0 files changed, 0 insertions, 0 deletions