mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 04:21:21 +00:00
Move is_dot_or_dotdotW into path.h.
This commit is contained in:
parent
81167385e9
commit
339f3d071e
@ -391,13 +391,6 @@ bool git_path_isfile(const char *path)
|
|||||||
|
|
||||||
#ifdef GIT_WIN32
|
#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)
|
bool git_path_is_empty_dir(const char *path)
|
||||||
{
|
{
|
||||||
git_buf pathbuf = GIT_BUF_INIT;
|
git_buf pathbuf = GIT_BUF_INIT;
|
||||||
@ -418,7 +411,7 @@ bool git_path_is_empty_dir(const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!is_dot_or_dotdotW(ffd.cFileName)) {
|
if (!git_path_is_dot_or_dotdotW(ffd.cFileName)) {
|
||||||
retval = false;
|
retval = false;
|
||||||
}
|
}
|
||||||
} while (FindNextFileW(hFind, &ffd) != 0);
|
} while (FindNextFileW(hFind, &ffd) != 0);
|
||||||
|
@ -91,6 +91,13 @@ GIT_INLINE(int) git_path_is_dot_or_dotdot(const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GIT_WIN32
|
#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.
|
* Convert backslashes in path to forward slashes.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user