This repository has been archived by the owner. It is now read-only.

Fixing path._makeLong to have consistent behavior across platforms #4508

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Member

geek commented Jan 2, 2013

On windows functions that depend on path._makeLong (like readdir) resolve relative paths. This PR updates the_makeLong export to have consistent behavior.

@geek geek closed this Jan 2, 2013

@geek geek reopened this Jan 2, 2013

Member

bnoordhuis commented Jan 3, 2013

Does this change fix an issue for you or is it for the sake of consistency?

Also, please see https://github.com/joyent/node/blob/v0.8/CONTRIBUTING.md - this change would need a test or two, reworded commit log, etc.

Member

piscisaureus commented Jan 3, 2013

On windows resolving paths is safe because of how windows handles symbolic link resolution in general (e.g. the windows API itself also resolves .. before attempting to resolve symbolic links).

I wonder how this works on unices, e.g. is '/path/to/symlink/../foo/bar' guaranteed to point at '/path/to/foo/bar' ?

If not, then _makeLong should leave '..' components untouched.

Member

bnoordhuis commented Jan 3, 2013

I wonder how this works on unices, e.g. is '/path/to/symlink/../foo/bar' guaranteed to point at '/path/to/foo/bar' ?

No, it'll point to /whatever/symlink/points/to/foo/bar.

Member

geek commented Jan 3, 2013

Is that a problem with path.resolve then?

isaacs commented Feb 18, 2013

I think the correct fix is to just not cast to strings on Windows, not to resolve paths on Unix.

joyent#4797

@isaacs isaacs closed this Feb 18, 2013

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.