Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const {
Float64Array,
NumberParseInt,
ObjectDefineProperties,
StringPrototypeEndsWith,
StringPrototypeSlice,
SymbolToPrimitive,
} = primordials;
Expand Down Expand Up @@ -184,9 +183,11 @@ function tmpdir() {
process.env.TMP ||
(process.env.SystemRoot || process.env.windir) + '\\temp';

if (path.length > 1 && StringPrototypeEndsWith(path, '\\') &&
!StringPrototypeEndsWith(path, ':\\'))
if (path.length > 1 && path[path.length - 1] === '\\' &&
!(path.length > 2 && path[path.length - 2] === ':' && path[path.length - 1] === '\\')) {
return StringPrototypeSlice(path, 0, -1);
}


return path;
}
Expand Down
Loading