repl: use path.resolve() for the module.filename
authorNathan Rajlich <nathan@tootallnate.net>
Tue, 13 Mar 2012 00:24:39 +0000 (17:24 -0700)
committerBert Belder <bertbelder@gmail.com>
Tue, 13 Mar 2012 18:58:49 +0000 (19:58 +0100)
Windows was seeing: "C:\\path\\to\\cwd/repl"

lib/repl.js

index b522d7a..9c5feb2 100644 (file)
@@ -59,7 +59,7 @@ var context;
 exports.disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
 
 // hack for require.resolve("./relative") to work properly.
-module.filename = process.cwd() + '/repl';
+module.filename = path.resolve('repl');
 
 // hack for repl require to work properly with node_modules folders
 module.paths = require('module')._nodeModulePaths(module.filename);