@@ -272,7 +272,6 @@ function patch (fs) {
272
272
}
273
273
}
274
274
275
-
276
275
function statFix ( orig ) {
277
276
if ( ! orig ) return orig
278
277
// Older versions of Node erroneously returned signed integers for
@@ -282,16 +281,15 @@ function patch (fs) {
282
281
cb = options
283
282
options = null
284
283
}
285
- function callback ( err , stats ) {
286
- if ( ! stats && cb ) return cb . apply ( this , arguments )
287
- if ( stats . uid < 0 ) stats . uid += 0x100000000
288
- if ( stats . gid < 0 ) stats . gid += 0x100000000
284
+ function callback ( er , stats ) {
285
+ if ( stats ) {
286
+ if ( stats . uid < 0 ) stats . uid += 0x100000000
287
+ if ( stats . gid < 0 ) stats . gid += 0x100000000
288
+ }
289
289
if ( cb ) cb . apply ( this , arguments )
290
290
}
291
- if ( options ) {
292
- return orig . call ( fs , target , options , callback ) ;
293
- }
294
- return orig . call ( fs , target , callback ) ;
291
+ return options ? orig . call ( fs , target , options , callback )
292
+ : orig . call ( fs , target , callback )
295
293
}
296
294
}
297
295
@@ -300,12 +298,8 @@ function patch (fs) {
300
298
// Older versions of Node erroneously returned signed integers for
301
299
// uid + gid.
302
300
return function ( target , options ) {
303
- var stats
304
- if ( options ) {
305
- stats = orig . call ( fs , target , options )
306
- } else {
307
- stats = orig . call ( fs , target )
308
- }
301
+ var stats = options ? orig . call ( fs , target , options )
302
+ : orig . call ( fs , target )
309
303
if ( stats . uid < 0 ) stats . uid += 0x100000000
310
304
if ( stats . gid < 0 ) stats . gid += 0x100000000
311
305
return stats ;
0 commit comments