FIX: FTP - detect encoding before getting current directory

This commit is contained in:
Alexander Koblov 2024-05-19 13:48:08 +03:00
commit d2416cc2a4
2 changed files with 4 additions and 2 deletions

View file

@ -580,6 +580,8 @@ begin
Result:= Connect;
if Result then
begin
if FAuto then DetectEncoding;
if (Length(FCurrentDir) = 0) then
begin
if not SendCommand('pwd', FAnswer) then
@ -609,7 +611,6 @@ begin
end;
end;
end;
if FAuto then DetectEncoding;
end;
end;

View file

@ -125,6 +125,8 @@ begin
Result:= Connect;
if Result then
begin
if FAuto then DetectEncoding;
if (Length(FCurrentDir) = 0) then
begin
SetLength(FCurrentDir, MAX_PATH + 1);
@ -137,7 +139,6 @@ begin
end;
DoStatus(False, 'Remote directory: ' + FCurrentDir);
end;
if FAuto then DetectEncoding;
end;
end;