Permalink
Browse files

pass parsed out new directory to cwd callback

  • Loading branch information...
1 parent 6523e57 commit 2b982d88436c7210c39b78c015ee834a5ab74443 @mscdex committed Dec 18, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/ftp.js
View
@@ -320,7 +320,11 @@ FTP.prototype.abort = function(immediate, cb) {
};
FTP.prototype.cwd = function(path, cb) {
- this._send('CWD ' + path, cb);
+ this._send('CWD ' + path, function(err, text, code) {
+ if (err)
+ return cb(err);
+ cb(undefined, /"(.+)"(?: |$)/.exec(text)[1]);
+ });
};
FTP.prototype.delete = function(path, cb) {

0 comments on commit 2b982d8

Please sign in to comment.