Skip to content
  • Jeff King's avatar
    trace: use strbuf for quote_crnl output · 0bb443fd
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When we output GIT_TRACE_SETUP paths, we quote any
    meta-characters. But our buffer to hold the result is only
    PATH_MAX bytes, and we could double the size of the input
    path (if every character needs quoting). We could use a
    2*PATH_MAX buffer, if we assume the input will never be more
    than PATH_MAX. But it's easier still to just switch to a
    strbuf and not worry about whether the input can exceed
    PATH_MAX or not.
    
    The original copied the "p2" pointer to "p1", advancing
    both. Since this gets rid of "p1", let's also drop "p2",
    whose name is now confusing. We can just advance the
    original "path" pointer.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    0bb443fd