Skip to content

Commit

Permalink
Fix remote directory parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ssvine committed Apr 10, 2024
1 parent 7eace54 commit 752874f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/SessionData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,13 +2487,13 @@ bool TSessionData::ParseUrl(const UnicodeString & AUrl, TOptions * Options,
{
DoCopyData(Data, ParseOnly);
FSource = Data->FSource;
/*int32_t P = 1;
int32_t P = 1;
while (!AnsiSameText(DecodeUrlChars(Url.SubString(1, P)), SessionNameWithoutFolder))
{
P++;
DebugAssert(P <= Url.Length());
}
ARemoteDirectory = Url.SubString(P + 1, Url.Length() - P);*/
ARemoteDirectory = Url.SubString(P + 1, Url.Length() - P);

if (Data->Hidden && !ParseOnly)
{
Expand Down Expand Up @@ -2665,6 +2665,7 @@ bool TSessionData::ParseUrl(const UnicodeString & AUrl, TOptions * Options,
}
}

ARemoteDirectory = ARemoteDirectory.TrimRight();
if (!ARemoteDirectory.IsEmpty() && (ARemoteDirectory != ROOTDIRECTORY))
{
if ((ARemoteDirectory[ARemoteDirectory.Length()] != Slash) &&
Expand All @@ -2673,7 +2674,7 @@ bool TSessionData::ParseUrl(const UnicodeString & AUrl, TOptions * Options,
*AFileName = DecodeUrlChars(base::UnixExtractFileName(ARemoteDirectory));
ARemoteDirectory = base::UnixExtractFilePath(ARemoteDirectory);
}
SetRemoteDirectory(DecodeUrlChars(RemoteDirectory));
SetRemoteDirectory(DecodeUrlChars(ARemoteDirectory));
// Is already true for ad-hoc URL, but we want to error even for "storedsite/path/"-style URL.
RequireDirectories = true;
}
Expand Down

0 comments on commit 752874f

Please sign in to comment.