From bc1fe3a21d72c2af4781bf93cfb761796717a5e9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 21 Mar 2015 14:37:46 +0100 Subject: [PATCH 1/2] Working on v2.0.0 --- src/node_version.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_version.h b/src/node_version.h index 42136cbfa3805e..ba1b52ef18ede3 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -1,9 +1,9 @@ #ifndef SRC_NODE_VERSION_H_ #define SRC_NODE_VERSION_H_ -#define NODE_MAJOR_VERSION 1 -#define NODE_MINOR_VERSION 6 -#define NODE_PATCH_VERSION 2 +#define NODE_MAJOR_VERSION 2 +#define NODE_MINOR_VERSION 0 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_RELEASE 0 @@ -45,6 +45,6 @@ * an API is broken in the C++ side, including in v8 or * other dependencies. */ -#define NODE_MODULE_VERSION 43 /* io.js v1.1.0 */ +#define NODE_MODULE_VERSION 44 /* io.js v2.x */ #endif /* SRC_NODE_VERSION_H_ */ From bb97b70eb709b0e0470a5164b3722c292859618a Mon Sep 17 00:00:00 2001 From: Christian Tellnes Date: Fri, 6 Feb 2015 23:27:22 +0100 Subject: [PATCH 2/2] os: remove trailing slash from os.tmpdir() This commit makes `os.tmpdir()` behave consistently on all platforms. It changes `os.tmpdir()` to always return a path without trailing slash. Semver: major Fixes: https://github.com/iojs/io.js/issues/715 PR-URL: https://github.com/iojs/io.js/pull/747 Reviewed-By: Ben Noordhuis --- lib/os.js | 8 ++++++-- test/parallel/test-os.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/os.js b/lib/os.js index 75a863e2f72d1e..cd4eb1c12f49bc 100644 --- a/lib/os.js +++ b/lib/os.js @@ -23,16 +23,20 @@ exports.platform = function() { }; exports.tmpdir = function() { + var path; if (isWindows) { - return process.env.TEMP || + path = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + '\\temp'; } else { - return process.env.TMPDIR || + path = process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; } + if (/[\\\/]$/.test(path)) + path = path.slice(0, -1); + return path; }; exports.tmpDir = exports.tmpdir; diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index ae57353435333a..b5f39973a6f71f 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -13,6 +13,8 @@ if (process.platform === 'win32') { process.env.TMP = ''; var expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; assert.equal(os.tmpdir(), expected); + process.env.TEMP = '\\temp\\'; + assert.equal(os.tmpdir(), '\\temp'); } else { assert.equal(os.tmpdir(), '/tmpdir'); process.env.TMPDIR = ''; @@ -21,6 +23,8 @@ if (process.platform === 'win32') { assert.equal(os.tmpdir(), '/temp'); process.env.TEMP = ''; assert.equal(os.tmpdir(), '/tmp'); + process.env.TMPDIR = '/tmpdir/'; + assert.equal(os.tmpdir(), '/tmpdir'); } var endianness = os.endianness();