Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

windows: ensure fs_event always provides filename #1436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/win/fs-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
/*
* We attempt to convert the file name to its long form for
* events that still point to valid files on disk.
* For removed and renamed events, we do not provide the file name.
* For removed and renamed from events, we do not provide the
* long file name.
*/
if (file_info->Action != FILE_ACTION_REMOVED &&
file_info->Action != FILE_ACTION_RENAMED_OLD_NAME) {
Expand Down Expand Up @@ -420,18 +421,15 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
long_filenamew = NULL;
}
}
}

/*
* If we couldn't get the long name - just use the name
* provided by ReadDirectoryChangesW.
*/
if (!long_filenamew) {
filenamew = file_info->FileName;
sizew = file_info->FileNameLength / sizeof(WCHAR);
}
} else {
/* Removed or renamed callbacks don't provide filename. */
filenamew = NULL;
/*
* If we couldn't get the long name - just use the name
* provided by ReadDirectoryChangesW.
*/
if (!long_filenamew) {
filenamew = file_info->FileName;
sizew = file_info->FileNameLength / sizeof(WCHAR);
}
} else {
/* We already have the long name of the file, so just use it. */
Expand Down