mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-28 15:45:21 -05:00
fixup! fsmonitor-fs-listen-win32: implement FSMonitor backend on Windows
Let's keep avoiding the `*A()` family of Win32 API functions because they are susceptible to incoherent encoding problems. In Git for Windows, we always assume paths to be UTF-8 encoded. Let's use the dedicated helper to convert such a path to the wide character version, and then use the `*W()` function instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -111,8 +111,14 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
|
||||
DWORD share_mode =
|
||||
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE;
|
||||
HANDLE hDir;
|
||||
wchar_t wpath[MAX_PATH];
|
||||
|
||||
hDir = CreateFileA(path,
|
||||
if (xutftowcs_long_path(wpath, path) < 0) {
|
||||
error(_("could not convert to wide characters: '%s'"), path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hDir = CreateFileW(wpath,
|
||||
desired_access, share_mode, NULL, OPEN_EXISTING,
|
||||
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
|
||||
NULL);
|
||||
|
||||
Reference in New Issue
Block a user