mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 12:57:05 +00:00
diriter: don't double '/' on Windows
The canonical directory path of the root directory of a volume on windows already ends in a slash (eg, `c:/`). This is true only at the volume root. Do not add a slash to paths in this case.
This commit is contained in:
parent
2cde210d47
commit
5a466befaf
@ -1166,7 +1166,11 @@ static int diriter_update_paths(git_path_diriter *diriter)
|
||||
diriter->path[path_len-1] = L'\0';
|
||||
|
||||
git_buf_truncate(&diriter->path_utf8, diriter->parent_utf8_len);
|
||||
git_buf_putc(&diriter->path_utf8, '/');
|
||||
|
||||
if (diriter->parent_utf8_len > 0 &&
|
||||
diriter->path_utf8.ptr[diriter->parent_utf8_len-1] != '/')
|
||||
git_buf_putc(&diriter->path_utf8, '/');
|
||||
|
||||
git_buf_put_w(&diriter->path_utf8, diriter->current.cFileName, filename_len);
|
||||
|
||||
if (git_buf_oom(&diriter->path_utf8))
|
||||
|
Loading…
Reference in New Issue
Block a user