From 916d45e27171377e3304c33b9aa499dc5a4f59d6 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Sat, 4 Apr 2020 21:14:08 +0000 Subject: [PATCH] Return quoted part of PWD 257 response. --- exec/load/ftp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exec/load/ftp.js b/exec/load/ftp.js index 2af3b16f42..db5c50a4cb 100644 --- a/exec/load/ftp.js +++ b/exec/load/ftp.js @@ -108,7 +108,7 @@ FTP.prototype.pwd = function() rstr = this.cmd("PWD", true); ret = parseInt(rstr, 10); if (ret === 257) - return rstr.replace(/^[0-9]+ /, ''); + return rstr.replace(/^257 "(.*)".*?$/, '$1'); return null; } @@ -302,5 +302,6 @@ FTP.prototype.do_get = function(src, dest, isdir) var f = new FTP('fd0b:71d1:b5ec::1'); f.passive = false; f.cwd("main"); +print(f.pwd()); print(f.dir('.')); f.logout(); -- GitLab