summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-07-12 10:48:14 +0200
committerGitHub <noreply@github.com>2019-07-12 10:48:14 +0200
commitf92d495d44bff2bdb6fd99524a93986ea268c9e8 (patch)
tree9600e76c539d8938eb5402cf829a2381ed58eb78 /src
parentdacac9e1e998c2fa185733236017d66b524e73b9 (diff)
parent5ae22a6373d7a135accf550d12150e2b9bfa8739 (diff)
downloadlibgit2-f92d495d44bff2bdb6fd99524a93986ea268c9e8.tar.gz
Merge pull request #5131 from pks-t/pks/fileops-mkdir-in-root
fileops: fix creation of directory in filesystem root
Diffstat (limited to 'src')
-rw-r--r--src/fileops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 0b732aabe..648ffbe5d 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -495,7 +495,9 @@ int git_futils_mkdir(
* equal to length of the root path). The path may be less than the
* root path length on Windows, where `C:` == `C:/`.
*/
- if ((len == 1 && parent_path.ptr[0] == '.') || len <= root_len) {
+ if ((len == 1 && parent_path.ptr[0] == '.') ||
+ (len == 1 && parent_path.ptr[0] == '/') ||
+ len <= root_len) {
relative = make_path.ptr;
break;
}