diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-02-05 13:12:02 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-02-05 13:12:02 +0200 |
| commit | 412b3887761be5e8910b824c81b6f3637137446c (patch) | |
| tree | 96eb9b8260632db3e4e08974870c795c096d7eed /src/util.h | |
| parent | f725931b4865317b58c1f1600724cb36e586c332 (diff) | |
| download | libgit2-412b3887761be5e8910b824c81b6f3637137446c.tar.gz | |
Add new utility method `git__joinpath`
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 67ff4aec1..0f010929f 100644 --- a/src/util.h +++ b/src/util.h @@ -58,6 +58,14 @@ extern int git__basename_r(char *buffer, size_t bufflen, const char *path); extern const char *git__topdir(const char *path); +/** + * Join two paths together. Takes care of properly fixing the + * middle slashes and everything + * + * Returns a newly allocated string; must be free'd manually. + */ +extern char *git__joinpath(const char *path_a, const char *path_b); + extern void git__hexdump(const char *buffer, size_t n); extern uint32_t git__hash(const void *key, int len, uint32_t seed); |
