Move is_dot_or_dotdotW into path.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/src/path.c b/src/path.c
index e640675..ee7e07e 100644
--- a/src/path.c
+++ b/src/path.c
@@ -391,13 +391,6 @@ bool git_path_isfile(const char *path)
#ifdef GIT_WIN32
-static bool is_dot_or_dotdotW(const wchar_t *name)
-{
- return (name[0] == L'.' &&
- (name[1] == L'\0' ||
- (name[1] == L'.' && name[2] == L'\0')));
-}
-
bool git_path_is_empty_dir(const char *path)
{
git_buf pathbuf = GIT_BUF_INIT;
@@ -418,7 +411,7 @@ bool git_path_is_empty_dir(const char *path)
}
do {
- if (!is_dot_or_dotdotW(ffd.cFileName)) {
+ if (!git_path_is_dot_or_dotdotW(ffd.cFileName)) {
retval = false;
}
} while (FindNextFileW(hFind, &ffd) != 0);
diff --git a/src/path.h b/src/path.h
index 1164770..a845b3a 100644
--- a/src/path.h
+++ b/src/path.h
@@ -91,6 +91,13 @@ GIT_INLINE(int) git_path_is_dot_or_dotdot(const char *name)
}
#ifdef GIT_WIN32
+GIT_INLINE(int) git_path_is_dot_or_dotdotW(const wchar_t *name)
+{
+ return (name[0] == L'.' &&
+ (name[1] == L'\0' ||
+ (name[1] == L'.' && name[2] == L'\0')));
+}
+
/**
* Convert backslashes in path to forward slashes.
*/