Skip to content

Commit

Permalink
Merge pull request nodejs#7 from lemire/simplify-fs
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
lemire authored Mar 26, 2024
2 parents 5d45646 + 423e15f commit c492c0d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,14 @@ void ToNamespacedPath(Environment* env, BufferValue* path) {
resolved_path2.size());
}
}
} else if (IsWindowsDeviceRoot(resolved_path[0]) &&
resolved_path[1] == ':' && resolved_path[2] == '\\') {
} else if (IsWindowsDeviceRoot(resolved_path[0]) && resolved_path[1] == ':' &&
resolved_path[2] == '\\') {
// Matched device root, convert the path to a long UNC path
std::string_view new_prefix = R"(\\?\")";
path->SetLength(new_prefix.size() + resolved_path.size());
memcpy(&path, new_prefix.data(), new_prefix.size());
memcpy(&path + new_prefix.size(),
resolved_path.data(),
resolved_path.size());
memcpy(
&path + new_prefix.size(), resolved_path.data(), resolved_path.size());
}

#endif
Expand Down

0 comments on commit c492c0d

Please sign in to comment.