summaryrefslogtreecommitdiff
path: root/src/filebuf.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-12-09 01:38:46 +0100
committerVicent Marti <tanoku@gmail.com>2011-12-09 01:38:46 +0100
commit40e73d6f8886d27ae9c7df059d995221e6d84710 (patch)
tree4a6136463adbaa22a9aea3eb605d6c0dfbc97a7e /src/filebuf.c
parente92386876606c734fae9d2f5bd6c80861ccfe409 (diff)
parent97769280ba9938ae27f6e06cbd0d5e8a768a86b9 (diff)
downloadlibgit2-40e73d6f8886d27ae9c7df059d995221e6d84710.tar.gz
Merge remote-tracking branch 'arrbee/git-buf-for-paths' into development
Conflicts: tests-clay/clay_main.c
Diffstat (limited to 'src/filebuf.c')
-rw-r--r--src/filebuf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/filebuf.c b/src/filebuf.c
index 6600bfa4b..aa47d5eb0 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -196,18 +196,19 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags)
/* If we are writing to a temp file */
if (flags & GIT_FILEBUF_TEMPORARY) {
- char tmp_path[GIT_PATH_MAX];
+ git_buf tmp_path = GIT_BUF_INIT;
/* Open the file as temporary for locking */
- file->fd = git_futils_mktmp(tmp_path, path);
+ file->fd = git_futils_mktmp(&tmp_path, path);
if (file->fd < 0) {
+ git_buf_free(&tmp_path);
error = GIT_EOSERR;
goto cleanup;
}
/* No original path */
file->path_original = NULL;
- file->path_lock = git__strdup(tmp_path);
+ file->path_lock = git_buf_detach(&tmp_path);
if (file->path_lock == NULL) {
error = GIT_ENOMEM;