Skip to content

Commit c2454a0

Browse files
isaacsry
authored andcommitted
Inadvertently introduced a bug in how single-dot path parts are handled.
1 parent 3b8e477 commit c2454a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ var posix = posixModule.exports;
668668
var pathModule = createInternalModule("path", function (exports) {
669669
exports.join = function () {
670670
var joined = "",
671-
dotre = /^\.\//g,
671+
dotre = /^\.\//,
672672
dotreplace = "",
673673
dotdotre = /(^|(\/)([^\/]+\/)?)\.\.\//g,
674674
dotdotreplace = ""
@@ -677,7 +677,7 @@ var pathModule = createInternalModule("path", function (exports) {
677677

678678
/* Some logic to shorten paths */
679679
if (part === ".") continue;
680-
while (dotre.exec(part)) part.replace(dotre, dotreplace);
680+
while (dotre.exec(part)) part = part.replace(dotre, dotreplace);
681681

682682
if (i === 0) {
683683
part = part.replace(/\/*$/, "/");

0 commit comments

Comments
 (0)