From c2454a0d067d1587f7fcc529543e521cc73620f0 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 16 Dec 2009 14:15:24 -0800 Subject: [PATCH] Inadvertently introduced a bug in how single-dot path parts are handled. --- src/node.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.js b/src/node.js index 9e7a2532b1..3a15b5cdf8 100644 --- a/src/node.js +++ b/src/node.js @@ -668,7 +668,7 @@ var posix = posixModule.exports; var pathModule = createInternalModule("path", function (exports) { exports.join = function () { var joined = "", - dotre = /^\.\//g, + dotre = /^\.\//, dotreplace = "", dotdotre = /(^|(\/)([^\/]+\/)?)\.\.\//g, dotdotreplace = "" @@ -677,7 +677,7 @@ var pathModule = createInternalModule("path", function (exports) { /* Some logic to shorten paths */ if (part === ".") continue; - while (dotre.exec(part)) part.replace(dotre, dotreplace); + while (dotre.exec(part)) part = part.replace(dotre, dotreplace); if (i === 0) { part = part.replace(/\/*$/, "/");