Skip to content

Commit

Permalink
Bug 1900: Cannot work with filenames ending with space with FTP proto…
Browse files Browse the repository at this point in the history
…col (2nd)

https://winscp.net/tracker/1900

Source commit: dfcd8239adf941e48efa1ccc2d6db461899cb2de
  • Loading branch information
martinprikryl committed Sep 1, 2020
1 parent b656219 commit f5b3917
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 10 additions & 10 deletions source/filezilla/FileZillaIntf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void __fastcall TFileZillaIntf::Destroying()
bool __fastcall TFileZillaIntf::SetCurrentPath(const wchar_t * APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->SetCurrentPath(Path), L"setcurrentpath");
}
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -176,52 +176,52 @@ bool __fastcall TFileZillaIntf::CustomCommand(const wchar_t * Command)
bool __fastcall TFileZillaIntf::MakeDir(const wchar_t* APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->MakeDir(Path), L"makedir");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::Chmod(int Value, const wchar_t* FileName,
const wchar_t* APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->Chmod(Value, FileName, Path), L"chmod");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::Delete(const wchar_t* FileName, const wchar_t* APath, bool FileNameOnly)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->Delete(FileName, Path, FileNameOnly), L"delete");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::RemoveDir(const wchar_t* FileName, const wchar_t* APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->RemoveDir(FileName, Path), L"removedir");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::Rename(const wchar_t* OldName,
const wchar_t* NewName, const wchar_t* APath, const wchar_t* ANewPath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath NewPath(ANewPath);
CServerPath Path(APath, false);
CServerPath NewPath(ANewPath, false);
return Check(FFileZillaApi->Rename(OldName, NewName, Path, NewPath), L"rename");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::List(const wchar_t * APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->List(Path), L"list");
}
//---------------------------------------------------------------------------
bool __fastcall TFileZillaIntf::ListFile(const wchar_t * FileName, const wchar_t * APath)
{
DebugAssert(FFileZillaApi != NULL);
CServerPath Path(APath);
CServerPath Path(APath, false);
return Check(FFileZillaApi->ListFile(FileName, Path), L"listfile");
}
//---------------------------------------------------------------------------
Expand All @@ -233,7 +233,7 @@ bool __fastcall TFileZillaIntf::FileTransfer(const wchar_t * LocalFile,

Transfer.localfile = LocalFile;
Transfer.remotefile = RemoteFile;
Transfer.remotepath = CServerPath(RemotePath);
Transfer.remotepath = CServerPath(RemotePath, false);
Transfer.get = Get;
Transfer.size = Size;
Transfer.server = *FServer;
Expand Down
2 changes: 0 additions & 2 deletions source/filezilla/ServerPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ const BOOL CServerPath::IsEmpty() const

BOOL CServerPath::AddSubdir(CString subdir)
{
subdir.TrimLeft( L" " );
subdir.TrimRight( L" " );
if (subdir == L"")
return FALSE;

Expand Down

0 comments on commit f5b3917

Please sign in to comment.