diff options
author | Patrick Steinhardt <ps@pks.im> | 2017-02-07 20:30:11 +0100 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-02-08 12:03:49 +0100 |
commit | 5d59520ccd4816080e68b5a3057653c15f3d6816 (patch) | |
tree | 9890bf77b2136b73034e8a731354cbbc20309917 /src/commit.c | |
parent | d8c06070a87ced23712eaa2b55a0cebb148f9f9a (diff) | |
download | libgit2-5d59520ccd4816080e68b5a3057653c15f3d6816.tar.gz |
path: get correct dirname for Windows root
Getting the dirname of a filesystem root should return the filesystem
root itself. E.g. the dirname of "/" is always "/". On Windows, we
emulate this behavior and as such, we should return e.g. "C:/" if
calling dirname on "C:/". But we currently fail to do so and instead
return ".", as we do not check if we actually have a Windows prefix
before stripping off the last directory component.
Fix this by calling out to `win32_prefix_length` immediately after
stripping trailing slashes, returning early if we have a prefix.
Diffstat (limited to 'src/commit.c')
0 files changed, 0 insertions, 0 deletions