Changed directory separators to use path.sep instead of '/'.

This commit is contained in:
claflamme 2014-12-23 21:33:49 -05:00
parent 53d7d4f345
commit 1b9032c638
2 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,7 @@
function noop() {} function noop() {}
var fs = require('fs'), var fs = require('fs'),
path = require('path'),
EventEmitter = require('events').EventEmitter, EventEmitter = require('events').EventEmitter,
TypeEmitter = require('./node-type-emitter'); TypeEmitter = require('./node-type-emitter');
@ -35,7 +36,7 @@
emitter.emit('names', curpath, files, noop); emitter.emit('names', curpath, files, noop);
files.forEachAsync(function (cont, file) { files.forEachAsync(function (cont, file) {
emitter.emit('name', curpath, file, noop); emitter.emit('name', curpath, file, noop);
fs.lstat(curpath + '/' + file, function (err, stat) { fs.lstat(curpath + path.sep + file, function (err, stat) {
stat = stat || {}; stat = stat || {};
stat.name = file; stat.name = file;
if (err) { if (err) {
@ -79,7 +80,7 @@
} }
function fullPath(v,i,o) { function fullPath(v,i,o) {
o[i]= [curpath, '/', v].join(''); o[i]= [curpath, path.sep, v].join('');
} }
curpath = pathname; curpath = pathname;

View File

@ -9,6 +9,7 @@
, EventEmitter = require('events').EventEmitter , EventEmitter = require('events').EventEmitter
, TypeEmitter = require('./node-type-emitter') , TypeEmitter = require('./node-type-emitter')
, util = require('util') , util = require('util')
, path = require('path')
; ;
function appendToDirs(stat) { function appendToDirs(stat) {
@ -95,7 +96,7 @@
me._wCurFileCallback = cont; me._wCurFileCallback = cont;
me.emit('name', me._wcurpath, file, noop); me.emit('name', me._wcurpath, file, noop);
statPath = me._wcurpath + '/' + file; statPath = me._wcurpath + path.sep + file;
if (!me._wsync) { if (!me._wsync) {
// TODO how to remove this anony? // TODO how to remove this anony?
@ -256,7 +257,7 @@
var me = this var me = this
; ;
o[i] = [me._wcurpath, '/', v].join(''); o[i] = [me._wcurpath, path.sep, v].join('');
}; };
Walker.prototype.pause = function () { Walker.prototype.pause = function () {
this._paused = true; this._paused = true;