Skip to content
Commits on Dec 17, 2008
  1. @torvalds @gitster

    Add generic 'strbuf_readlink()' helper function

    torvalds committed with gitster
    It was already what 'git apply' did in read_old_data(), just export it
    as a real function, and make it be more generic.
    In particular, this handles the case of the lstat() st_size data not
    matching the readlink() return value properly (which apparently happens
    at least on NTFS under Linux).  But as a result of this you could also
    use the new function without even knowing how big the link is going to
    be, and it will allocate an appropriately sized buffer.
    So we pass in the st_size of the link as just a hint, rather than a
    fixed requirement.
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.