Skip to content

Commit

Permalink
system() should parse out just the OS name
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Dec 17, 2012
1 parent e0622ed commit 68bae50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -164,7 +164,7 @@ Methods

* **pwd**(< _function_ >callback) - _(void)_ - Retrieves the current working directory. `callback` has 2 parameters: < _Error_ >err, < _string_ >cwd.

* **system**(< _function_ >callback) - _(void)_ - Retrieves information about the server's operating system. `callback` has 2 parameters: < _Error_ >err, < _string_ >info.
* **system**(< _function_ >callback) - _(void)_ - Retrieves the server's operating system. `callback` has 2 parameters: < _Error_ >err, < _string_ >OS.

### Extended commands (RFC 3659)

Expand Down
6 changes: 5 additions & 1 deletion ftp.js
Expand Up @@ -428,7 +428,11 @@ FTP.prototype.rmdir = function(path, cb) { // RMD is optional
};

FTP.prototype.system = function(cb) { // SYST is optional
this._send('SYST', cb);
this._send('SYST', function(err, text) {
if (err)
return cb(err);
cb(undefined, /^([^ ]+)(?: |$)/.exec(text)[1]);
});
};

// "Extended" (RFC 3659) commands
Expand Down

0 comments on commit 68bae50

Please sign in to comment.