diff options
author | Vicent Martà <tanoku@gmail.com> | 2011-09-02 06:08:47 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2011-09-02 06:08:47 -0700 |
commit | 564f0f7be1d962fdb3bdc42e7e47db9c1ce960ec (patch) | |
tree | 9c791ac04d9f882331ce4314c8da5579a6b4a0d4 | |
parent | c035ede234675075abee8a2546a05113f72450ed (diff) | |
parent | 13bc2016b7aaa3d7d17337fe7737481c67b2cb8a (diff) | |
download | libgit2-564f0f7be1d962fdb3bdc42e7e47db9c1ce960ec.tar.gz |
Merge pull request #388 from lambourg/master
pull request for #387
-rw-r--r-- | src/path.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c index 1f7a16679..374694432 100644 --- a/src/path.c +++ b/src/path.c @@ -96,6 +96,16 @@ int git_path_dirname_r(char *buffer, size_t bufflen, const char *path) len = endp - path +1; +#ifdef GIT_WIN32 + /* Mimic unix behavior where '/.git' returns '/': 'C:/.git' will return + 'C:/' here */ + + if (len == 2 && isalpha(path[0]) && path[1] == ':') { + len = 3; + goto Exit; + } +#endif + Exit: result = len; if (len+1 > GIT_PATH_MAX) { |