diff options
author | Romain Geissler <romain.geissler@gmail.com> | 2011-06-05 00:18:34 +0200 |
---|---|---|
committer | Romain Geissler <romain.geissler@gmail.com> | 2011-06-05 00:18:34 +0200 |
commit | f2a60854cd174006fc2fa9b9f2af4c3e54672e96 (patch) | |
tree | 1a1b7d8beb5c2941773d4f3b2c4c2557ee41e9f6 | |
parent | 8b05e780180072d1fab525ec29100d63beb104a6 (diff) | |
download | libgit2-f2a60854cd174006fc2fa9b9f2af4c3e54672e96.tar.gz |
Repository: Fixed the path returned by read_gitfile (remove trailing slashes)
-rw-r--r-- | src/repository.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/repository.c b/src/repository.c index 91f27d406..47d58e4eb 100644 --- a/src/repository.c +++ b/src/repository.c @@ -418,6 +418,13 @@ static int read_gitfile(char *path_out, size_t size, const char *file_path, cons } error = gitfo_prettify_dir_path(path_out, size, data + GIT_FILE_CONTENT_PREFIX_LENGTH, base_path); + if (error == GIT_SUCCESS) { + end_offset = strlen(path_out); + + if (end_offset > 0 && path_out[end_offset - 1] == '/') + path_out[end_offset - 1 ] = '\0'; + } + gitfo_free_buf(&file); return error; |