* closedir fixes, which now disposes the pdir itself

This commit is contained in:
peter 1999-07-28 23:18:35 +00:00
parent f58e010de1
commit f434ea3131
2 changed files with 12 additions and 17 deletions

View File

@ -541,11 +541,11 @@ Begin
begin
{$IFDEF CRTLIB}
_rtl_closeDir(f.dirptr);
Dispose(pdir(f.dirptr)^.buf);
Dispose(pdir(f.dirptr));
{$ELSE}
closedir(pdir(f.dirptr));
{$ENDIF}
Dispose(pdir(f.dirptr)^.buf);
Dispose(pdir(f.dirptr));
end;
End;
end;
@ -1046,7 +1046,10 @@ End.
{
$Log$
Revision 1.11 1999-07-24 11:18:11 peter
Revision 1.12 1999-07-28 23:18:35 peter
* closedir fixes, which now disposes the pdir itself
Revision 1.11 1999/07/24 11:18:11 peter
* fixed getfattr which didn't reset doserror
Revision 1.10 1999/03/05 13:09:57 peter

View File

@ -617,12 +617,6 @@ var
d : pdirent;
mountpoint : boolean;
predot : string[255];
procedure dodispose (p : pdir);
begin
dispose (p^.buf);
dispose (p)
end;
{$endif}
begin
drivenr:=0;
@ -665,18 +659,13 @@ begin
d:=nil;
end;
until (d=nil) or ((thisdir.dev=thisdev) and (thisdir.ino=thisino) );
if (closedir (dirstream)<0) or (d=nil) then
begin
dodispose (dirstream);
exit;
end;
if (closedir(dirstream)<0) or (d=nil) then
exit;
{ At this point, d.name contains the name of the current dir}
thedir:='/'+strpas(@(d^.name[0]))+thedir;
thisdev:=dotdotdev;
thisino:=dotdotino;
predot:=predot+'../';
{ We don't want to clutter op the heap with DIR records... }
dodispose (dirstream);
end;
{ Now rootino=thisino and rootdev=thisdev so we've reached / }
dir:=thedir
@ -735,7 +724,10 @@ End.
{
$Log$
Revision 1.24 1999-05-17 21:52:42 florian
Revision 1.25 1999-07-28 23:18:36 peter
* closedir fixes, which now disposes the pdir itself
Revision 1.24 1999/05/17 21:52:42 florian
* most of the Object Pascal stuff moved to the system unit
Revision 1.23 1999/04/08 12:23:04 peter