Skip to content

Commit

Permalink
Bug 1659: Relative long paths are not handled correctly
Browse files Browse the repository at this point in the history
https://winscp.net/tracker/1659

Source commit: 20c5802e3fa677c83e78bc3cb37fa1b46a63bdf2
  • Loading branch information
martinprikryl committed Jul 5, 2018
1 parent ed0b0ad commit 1f21f57
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/core/Common.cpp
Expand Up @@ -1144,6 +1144,13 @@ UnicodeString __fastcall MakeUnicodeLargePath(UnicodeString Path)
//---------------------------------------------------------------------------
UnicodeString __fastcall ApiPath(UnicodeString Path)
{
UnicodeString Drive = ExtractFileDrive(Path);
// This may match even a path like "C:" or "\\server\\share", but we do not really care
if (Drive.IsEmpty() || (Path.SubString(Drive.Length() + 1, 1) != L"\\"))
{
Path = ExpandFileName(Path);
}

if (Path.Length() >= MAX_PATH)
{
if (Configuration != NULL)
Expand Down

0 comments on commit 1f21f57

Please sign in to comment.