summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-02-04 18:24:31 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-02-05 12:27:16 -0500
commit3c68bfcd088dd5a1ef06b98ea7fd203bb048fa42 (patch)
treed01ed483a295995e617dba40f93306f722f551bf /src/win32
parent2f4ee00039ebe63e2d954ede118593c279486893 (diff)
downloadlibgit2-3c68bfcd088dd5a1ef06b98ea7fd203bb048fa42.tar.gz
stat: don't remove trailing '/' from root on win32
`p_stat` calls `git_win32_path_from_utf8`, which canonicalizes the path. Do not further try to modify the path, else we trim the trailing slash from a root directory and try to access `C:` instead of `C:/`.
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/posix_w32.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index e446ccab0..346f537e4 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -448,12 +448,8 @@ int p_stat(const char* path, struct stat* buf)
git_win32_path path_w;
int len;
- if ((len = git_win32_path_from_utf8(path_w, path)) < 0)
- return -1;
-
- git_win32__path_trim_end(path_w, len);
-
- if (lstat_w(path_w, buf, false) < 0)
+ if ((len = git_win32_path_from_utf8(path_w, path)) < 0 ||
+ lstat_w(path_w, buf, false) < 0)
return -1;
/* The item is a symbolic link or mount point. No need to iterate