-
Notifications
You must be signed in to change notification settings - Fork 7.3k
path: resolve()
doesn't normalize drive letter on Windows
#7799
Conversation
Calling `resolve()` on Windows (in Node v0.11.0+) result in a path where drive letter case isn't always lowercase (e.g. for a relative path like '.') while `normalize()` always returns a path with a lower case drive letter. This eventually breaks comparisons between results of `resolve()` and `join()` (which relies on `normalize()`) for the same path. Fixes nodejs#7031
PS: First node contribution. CLA signed. |
@Fishrock123 thanks, missed that. |
I guess this may be the fix for #7806? This lack of normalizing can completely break builds on Windows in hard to debug ways... |
@mzgol yes, updated the pull request message accordingly. |
@mrfabbri Can you update commit message as well? |
@jonschlinkert the problem is specific to Windows (as the changes in the PR, affecting a code path relative to Windows): on the documentation for The reasoning was to port the same behaviour of As a side note, I experienced the bug while testing a node-webkit (which uses node v0.11.x) app on Windows. |
@orangemocha ... thoughts? |
Calling
resolve()
on Windows (in Node v0.11.0+) result in a path where driveletter case isn't always lowercase (e.g. for a relative path like '.') while
normalize()
always returns a path with a lower case drive letter.This eventually breaks comparisons between results of
resolve()
andjoin()
(which relies onnormalize()
) for the same path.Fixes #7031 also resolves #7806