mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
codetools: directorycache: no exception on virtual directory, #40503
This commit is contained in:
parent
89824a258b
commit
0fd939a3e4
@ -804,7 +804,8 @@ begin
|
||||
if FListing.FileTimeStamp=Pool.FileTimeStamp then exit;
|
||||
FListing.Clear;
|
||||
FListing.FileTimeStamp:=Pool.FileTimeStamp;
|
||||
if Directory='' then exit;// virtual directory
|
||||
if not FilenameIsAbsolute(Directory) then
|
||||
exit;// virtual directory
|
||||
|
||||
// Note: do not add a 'if not DirectoryExistsUTF8 then exit'.
|
||||
// This will not work on automounted directories. You must use FindFirstUTF8.
|
||||
@ -936,8 +937,11 @@ constructor TCTDirectoryCache.Create(const TheDirectory: string;
|
||||
end;
|
||||
|
||||
begin
|
||||
FDirectory:=AppendPathDelim(TrimFilename(TheDirectory));
|
||||
if FDirectory='.' then FDirectory:='';
|
||||
FDirectory:=TrimFilename(TheDirectory);
|
||||
if FDirectory='.' then
|
||||
FDirectory:=''
|
||||
else
|
||||
FDirectory:=AppendPathDelim(FDirectory);
|
||||
if (FDirectory<>'') and not FilenameIsAbsolute(FDirectory) then
|
||||
RaiseDirNotAbsolute;
|
||||
FListing:=TCTDirectoryListing.Create;
|
||||
@ -2244,7 +2248,8 @@ begin
|
||||
if FListing.FileTimeStamp=Pool.FileTimeStamp then exit;
|
||||
FListing.Clear;
|
||||
FListing.FileTimeStamp:=Pool.FileTimeStamp;
|
||||
if Directory='' then exit;// virtual directory
|
||||
if not FilenameIsAbsolute(Directory) then
|
||||
exit;// virtual directory
|
||||
|
||||
// gather all sub dirs and files
|
||||
SortMap:=nil;
|
||||
|
Loading…
Reference in New Issue
Block a user