• J
    parse_options: allocate a new array when concatenating · 023ff39b
    Jeff King 提交于
    In exactly one callers (builtin/revert.c), we build up the
    options list dynamically from multiple arrays. We do so by
    manually inserting "filler" entries into one array, and then
    copying the other array into the allocated space.
    
    This is tedious and error-prone, as you have to adjust the
    filler any time the second array is modified (although we do
    at least check and die() when the counts do not match up).
    
    Instead, let's just allocate a new array.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    023ff39b
parse-options-cb.c 4.9 KB