Skip to content
  • Jeff King's avatar
    parse_options: allocate a new array when concatenating · 023ff39b
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    023ff39b