summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:10 (GMT)
commit4ef9caf5431dbbd23f240a25b69a989aeb9840a4 (patch)
tree0e8e6e9c88bc1c56840256a5f43e4a6097017d70 /builtin/remote.c
parentb260d265e189728b26e50506ac6ffab6a7d588da (diff)
downloadgit-4ef9caf5431dbbd23f240a25b69a989aeb9840a4.zip
git-4ef9caf5431dbbd23f240a25b69a989aeb9840a4.tar.gz
git-4ef9caf5431dbbd23f240a25b69a989aeb9840a4.tar.bz2
path.c: make get_pathname() return strbuf instead of static buffer
We've been avoiding PATH_MAX whenever possible. This patch makes get_pathname() return a strbuf and updates the callers to take advantage of this. The code is simplified as we no longer need to worry about buffer overflow. vsnpath() behavior is changed slightly: previously it always clears the buffer before writing, now it just appends. Fortunately this is a static function and all of its callers prepare the buffer properly: git_path() gets the buffer from get_pathname() which resets the buffer, the remaining call sites start with STRBUF_INIT'd buffer. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/remote.c')
0 files changed, 0 insertions, 0 deletions