GeezerVison is showing github.com — Please give the trailing slash back to os.tmpdir() · Issue #1669 · nodejs/node
Please give the trailing slash back to os.tmpdir() #1669Labels osIssues and PRs related to the os subsystem. DescriptionPlease revert the commit b57cc51
Since we can get any string (like "/oh/my/xxx/////"), from the environment, why bother to remove the trailing slash? For consistency between __dirname and os.tmpdir() #715 #747 ?? Activitymscdex commented on May 10, 2015 Why not use path.join() or similar path methods?
$ iojs
> path.join('/oh/my/xxx/////', 'bar')
'/oh/my/xxx/bar'
rlidwka commented on May 10, 2015
If the string "/" comes from the user environment (though hardly possible), gets trimmed into "", what directory does it represent (and on what platform)?
That's true actually:
$ TEMP=/ ~/io.js/iojs -e 'console.log(JSON.stringify(require("os").tmpdir()))'
""
/ should not be removed if it's the only character there.
dirname works correctly in that case:
$ cat /test.js
console.log(__dirname)
$ ~/io.js/iojs /test.js
/ Fishrock123 commented on May 10, 2015 brendanashworth commented on May 10, 2015 Perhaps semver-major changes aren't looked at hard enough... maybe we should introduce a hard minimum amount of reviewers for a major change, say 3. tellnes commented on May 10, 2015 We could change it so we remove all trailing slashes and keep one if there is no other characters there? benjamingr commented on May 10, 2015 @tellnes Yeah, that sounds like a solid workaround.
@jakwings would that satisfy you? I realize this is a breaking change and that you'd have to normalize it through the library, but isn't that a one-time thing and the new behavior makes more sense? tellnes commented on May 11, 2015 So remove trailing path.sep then, but keep one if there is no other characters? cjihrig commented on May 13, 2015 As of 7693705, trailing slashes will not be stripped from / or C:\. Additionally, only slashes relevant to the current operating system will be stripped.
MetadataMetadataosIssues and PRs related to the os subsystem. DevelopmentNo branches or pull requestsIssue actions
|