Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2012-04-20 22:00:59 +0400
committerSven Strickroth <email@cs-ware.de>2012-04-20 22:12:48 +0400
commiteb6db16d8267b0e62a50627dd7b6cfae472d8610 (patch)
tree5bd79f3bc355dda1b1d81633c1b7c1043f4d2e3f /src/path.c
parent31e80290a1a08a24780a0cbedd3a400fccd80a8b (diff)
GetFileAttributes does not work for utf-8 encoded paths
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/path.c b/src/path.c
index d2c292bf2..2e6a1eb40 100644
--- a/src/path.c
+++ b/src/path.c
@@ -9,6 +9,7 @@
#include "posix.h"
#ifdef GIT_WIN32
#include "win32/dir.h"
+#include "win32/posix.h"
#else
#include <dirent.h>
#endif
@@ -362,20 +363,11 @@ int git_path_exists(const char *path)
int git_path_isdir(const char *path)
{
-#ifdef GIT_WIN32
- DWORD attr = GetFileAttributes(path);
- if (attr == INVALID_FILE_ATTRIBUTES)
- return GIT_ERROR;
-
- return (attr & FILE_ATTRIBUTE_DIRECTORY) ? GIT_SUCCESS : GIT_ERROR;
-
-#else
struct stat st;
if (p_stat(path, &st) < GIT_SUCCESS)
return GIT_ERROR;
return S_ISDIR(st.st_mode) ? GIT_SUCCESS : GIT_ERROR;
-#endif
}
int git_path_isfile(const char *path)