Skip to content
Commits on Jul 4, 2015
  1. @mhagger @gitster

    strbuf: strbuf_read_file() should return ssize_t

    mhagger committed with gitster
    It is currently declared to return int, which could overflow for
    large files.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 26, 2012
  1. @mhagger @gitster

    Add new function strbuf_add_xml_quoted()

    mhagger committed with gitster
    Substantially the same code is present in http-push.c and imap-send.c,
    so make a library function out of it.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 4, 2012
  1. @mhagger @peff

    strbuf_split*(): rename "delim" parameter to "terminator"

    mhagger committed with peff
    The word "delimiter" suggests that the argument separates the
    substrings, whereas in fact (1) the delimiter characters are included
    in the output, and (2) if the input string ends with the delimiter,
    then the output does not include a final empty string.  So rename the
    "delim" arguments of the strbuf_split() family of functions to
    "terminator", which is more suggestive of how it is used.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Jeff King <peff@peff.net>
  2. @mhagger @peff

    strbuf_split_buf(): simplify iteration

    mhagger committed with peff
    While iterating, update str and slen to keep track of the part of the
    string that hasn't been processed yet rather than computing things
    relative to the start of the original string.  This eliminates one
    local variable, reduces the scope of another, and reduces the amount
    of arithmetic needed within the loop.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Jeff King <peff@peff.net>
  3. @mhagger @peff

    strbuf_split_buf(): use ALLOC_GROW()

    mhagger committed with peff
    Use ALLOC_GROW() rather than inline code to manage memory in
    strbuf_split_buf().  Rename "pos" to "nr" because it better describes
    the use of the variable and it better conforms to the "ALLOC_GROW"
    idiom.
    
    Also, instead of adding a sentinal NULL value after each entry is
    added to the list, only add it once after all of the entries have been
    added.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Jeff King <peff@peff.net>
Something went wrong with that request. Please try again.