Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug that causes premature 'end' event

Since endChmod may call its callback directly, todo may hit 1 and then
0 without this change.  This bug was causing tar extraction by node-tar
to emit 'end' before the final chown and utimes.
  • Loading branch information...
commit 26ed2851c65105e380d72d7de4ce0b08c8fd720d 1 parent c33d4c7
@dgreensp dgreensp authored isaacs committed
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/writer.js
View
5 lib/writer.js
@@ -290,13 +290,13 @@ Writer.prototype._finish = function () {
return
function setProps (current) {
+ todo += 3
endChmod(me, me.props, current, me._path, next("chmod"))
endChown(me, me.props, current, me._path, next("chown"))
- endUtimes(me, me.props, current, me._path, next("chown"))
+ endUtimes(me, me.props, current, me._path, next("utimes"))
}
function next (what) {
- todo ++
return function (er) {
// console.error(" W Finish", what, todo)
if (errState) return
@@ -387,4 +387,3 @@ function objectToString (d) {
function isDate(d) {
return typeof d === 'object' && objectToString(d) === '[object Date]';
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.