mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 21:08:56 +00:00
Fix for issue #387
This commit is contained in:
parent
52e50c1a80
commit
13bc2016b7
10
src/path.c
10
src/path.c
@ -96,6 +96,16 @@ int git_path_dirname_r(char *buffer, size_t bufflen, const char *path)
|
|||||||
|
|
||||||
len = endp - path +1;
|
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:
|
Exit:
|
||||||
result = len;
|
result = len;
|
||||||
if (len+1 > GIT_PATH_MAX) {
|
if (len+1 > GIT_PATH_MAX) {
|
||||||
|
Loading…
Reference in New Issue
Block a user