Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/ftpd.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ var starttls = require('./starttls');
- maybe just for milesplit's use?
*/

function withCwd(cwd, p) {
if (!cwd)
return p;
else if (!p)
return cwd;
else if (p.length > 0 && (p.charAt(0) == '/' || p.charAt(0) == pathModule.sep))
return p;
else
return pathModule.join(cwd, p);
function withCwd(cwd, path) {
var firstChar = (path || '').charAt(0);
cwd = cwd || pathModule.sep;
path = path || pathModule.sep;
if (firstChar === '/' || firstChar === pathModule.sep) {
cwd = pathModule.sep;
}
path = pathModule.join(cwd, path);
return path;
}

// Currently used for stripping options from beginning of argument to LIST and NLST.
Expand Down