Browse Source

Inadvertently introduced a bug in how single-dot path parts are handled.

v0.7.4-release
isaacs 15 years ago
committed by Ryan Dahl
parent
commit
c2454a0d06
  1. 4
      src/node.js

4
src/node.js

@ -668,7 +668,7 @@ var posix = posixModule.exports;
var pathModule = createInternalModule("path", function (exports) { var pathModule = createInternalModule("path", function (exports) {
exports.join = function () { exports.join = function () {
var joined = "", var joined = "",
dotre = /^\.\//g, dotre = /^\.\//,
dotreplace = "", dotreplace = "",
dotdotre = /(^|(\/)([^\/]+\/)?)\.\.\//g, dotdotre = /(^|(\/)([^\/]+\/)?)\.\.\//g,
dotdotreplace = "" dotdotreplace = ""
@ -677,7 +677,7 @@ var pathModule = createInternalModule("path", function (exports) {
/* Some logic to shorten paths */ /* Some logic to shorten paths */
if (part === ".") continue; if (part === ".") continue;
while (dotre.exec(part)) part.replace(dotre, dotreplace); while (dotre.exec(part)) part = part.replace(dotre, dotreplace);
if (i === 0) { if (i === 0) {
part = part.replace(/\/*$/, "/"); part = part.replace(/\/*$/, "/");

Loading…
Cancel
Save