Commit 76937051 authored by cjihrig's avatar cjihrig
Browse files

os: refine tmpdir() trailing slash stripping

os.tmpdir() began stripping trailing slashes in
b57cc51d. This causes problems if
the temp directory is simply '/'. It also stripped trailing
slashes without first determining which slash type is used by
the current operating system. This commit only strips trailing
slashes if another character precedes the slash. On Windows, it
checks for ':', as not to strip slashes from something like 'C:\'.
It also only strips slashes that are appropriate for the user's
operating system.

Fixes: https://github.com/iojs/io.js/issues/1669
PR-URL: https://github.com/iojs/io.js/pull/1673


Reviewed-By: default avatarRod Vagg <rod@vagg.org>
Reviewed-By: default avatarChristian Tellnes <christian@tellnes.no>
parent 966acb99
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment