mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 18:09:20 +02:00
* Fix bug ID #35674, do not create filestream for directories
git-svn-id: trunk@42174 -
This commit is contained in:
parent
a4bf16e176
commit
109abf3d99
@ -2147,7 +2147,7 @@ Begin
|
|||||||
If Assigned(FOnCreateStream) then
|
If Assigned(FOnCreateStream) then
|
||||||
FOnCreateStream(Self, OutStream, Item);
|
FOnCreateStream(Self, OutStream, Item);
|
||||||
// If FOnCreateStream didn't create one, we create one now.
|
// If FOnCreateStream didn't create one, we create one now.
|
||||||
If (OutStream=Nil) then
|
If (OutStream=Nil) and (not Item.IsDirectory) then
|
||||||
begin
|
begin
|
||||||
if (Path<>'') then
|
if (Path<>'') then
|
||||||
ForceDirectories(Path);
|
ForceDirectories(Path);
|
||||||
@ -2173,7 +2173,8 @@ Begin
|
|||||||
OutStream := nil;
|
OutStream := nil;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
FreeAndNil(OutStream);
|
if Assigned(OutStream) then
|
||||||
|
FreeAndNil(OutStream);
|
||||||
DoEndOfFile;
|
DoEndOfFile;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user