Skip to content
Merged
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
fs,win: do not add a second trailing slash in readdir
Do not add a trailing slash if it was not removed by resolve in
ToNamespacedPath.
  • Loading branch information
Flarna committed Sep 10, 2025
commit f8fd0828e5eab7a673f3da47b5c574cda0d450b3
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) {
ToNamespacedPath(env, &path);

#ifdef _WIN32
if (slashCheck) {
if (slashCheck && !path.ToStringView().ends_with("\\")) {
size_t new_length = path.length() + 1;
path.AllocateSufficientStorage(new_length + 1);
path.SetLengthAndZeroTerminate(new_length);
Expand Down
Loading