This commit is contained in:
Demetrius flavious 2026-06-19 03:16:17 +00:00 committed by GitHub
commit f33c2fe8f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View file

@ -176,7 +176,9 @@ end;
function TWinNetFileSource.IsNetworkPath(const Path: String): Boolean;
begin
Result:= (NumCountChars(PathDelim, ExcludeTrailingPathDelimiter(Path)) < 3);
Result:= (Path = PathDelim) or
((Pos(PathDelim + PathDelim, Path) = 1) and
(NumCountChars(PathDelim, ExcludeTrailingPathDelimiter(Path)) < 3));
end;
function TWinNetFileSource.SetCurrentWorkingDirectory(NewDir: String): Boolean;

View file

@ -6386,18 +6386,28 @@ end;
procedure TfrmMain.LoadTabsCommandLine(Params: TCommandLineParams);
procedure LoadPanel(aNoteBook: TFileViewNotebook; aPath: String);
var
AFileView: TFileView;
begin
if Length(aPath) <> 0 then
begin
aPath:= ReplaceEnvVars(ReplaceTilde(aPath));
if not mbFileSystemEntryExists(aPath) then
if not mbFileSystemEntryExists(aPath) and (Pos('\\', aPath) <> 1) then
aPath:= GetDeepestExistingPath(aPath);
if Length(aPath) <> 0 then
begin
if Params.NewTab then
AddTab(aNoteBook, aPath)
else
aNoteBook.ActivePage.FileView.ChangePathAndSetActiveFile(aPath)
else begin
AFileView:= aNoteBook.ActivePage.FileView;
if mbFileExists(aPath) then
begin
if ChooseFileSource(AFileView, ExtractFileDir(aPath)) then
AFileView.SetActiveFile(ExtractFileName(aPath));
end
else
ChooseFileSource(AFileView, aPath);
end;
end;
end;
end;