Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

path.join() changes casing of drive letter starting with 0.11.0 #7031

Closed
@AlexZeitler

Description

@AlexZeitler

Running this piece of code on Windows and Node.js 0.10.25 results as shown below.

Code:

var path = require('path');
var join = path.join;
var root = __dirname;
var relativePath = '/relativepath'
var joinedPath = join(root, relativePath);
console.log("root:",__dirname);
console.log("relative path:",relativePath);
console.log("joined path:", joinedPath);

Result (Node.js 0.10.25 on Windows 7 Pro x64):

root: D:\Code\PDMLab\nodetests
relative path: /relativepath
joined path: D:\Code\PDMLab\nodetests\relativepath

Result running the same code on Node.js 0.11.0 and later on Windows 7 Pro x64:

root: D:\Code\PDMLab\nodetests
relative path: /relativepath
joined path: d:\Code\PDMLab\nodetests\relativepath

As you can see, the drive letter now is lower case.

This behavior breaks modules like koa-send when it comes to using joined path instances.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions