summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2011-11-29 23:45:17 -0800
committerRussell Belfer <arrbee@arrbee.com>2011-11-29 23:45:17 -0800
commit309113c984c1f3157659dc1174e5d4218f610ae4 (patch)
tree63fb56773ea31214c1107dfa33dbecceec2b4c1c /src/commit.c
parent7df41387f5d09308acda0d4b54eccc1431c71610 (diff)
downloadlibgit2-309113c984c1f3157659dc1174e5d4218f610ae4.tar.gz
Make initial value of git_buf ptr always be a valid empty string.
Taking a page from core git's strbuf, this introduces git_buf_initbuf which is an empty string that is used to initialize the git_buf ptr value even for new buffers. Now the git_buf ptr will always point to a valid NUL-terminated string. This change required jumping through a few hoops for git_buf_grow and git_buf_free to distinguish between a actual allocated buffer and the global initial value. Also, this moves the allocation related functions to be next to each other near the top of buffer.c.
Diffstat (limited to 'src/commit.c')
0 files changed, 0 insertions, 0 deletions