@@ -105,9 +105,6 @@ util.unixifyPath = function() {
105105util . walkdir = function ( dirpath , base , callback ) {
106106 var results = [ ] ;
107107
108- dirpath = util . sanitizePath ( dirpath ) ;
109- dirpath = util . trailingSlashIt ( dirpath ) ;
110-
111108 if ( typeof base === 'function' ) {
112109 callback = base ;
113110 base = dirpath ;
@@ -116,6 +113,7 @@ util.walkdir = function(dirpath, base, callback) {
116113 fs . readdir ( dirpath , function ( err , list ) {
117114 var i = 0 ;
118115 var file ;
116+ var filepath ;
119117
120118 if ( err ) {
121119 return callback ( err ) ;
@@ -128,15 +126,17 @@ util.walkdir = function(dirpath, base, callback) {
128126 return callback ( null , results ) ;
129127 }
130128
131- fs . stat ( dirpath + file , function ( err , stats ) {
129+ filepath = path . join ( dirpath , file ) ;
130+
131+ fs . stat ( filepath , function ( err , stats ) {
132132 results . push ( {
133- path : dirpath + file ,
134- relative : path . relative ( base , dirpath + file ) . replace ( / \\ / g, '/' ) ,
133+ path : filepath ,
134+ relative : path . relative ( base , filepath ) . replace ( / \\ / g, '/' ) ,
135135 stats : stats
136136 } ) ;
137137
138138 if ( stats && stats . isDirectory ( ) ) {
139- util . walkdir ( dirpath + file , base , function ( err , res ) {
139+ util . walkdir ( filepath , base , function ( err , res ) {
140140 results = results . concat ( res ) ;
141141 next ( ) ;
142142 } ) ;
0 commit comments