* 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 begin
{$IFDEF CRTLIB} {$IFDEF CRTLIB}
_rtl_closeDir(f.dirptr); _rtl_closeDir(f.dirptr);
Dispose(pdir(f.dirptr)^.buf);
Dispose(pdir(f.dirptr));
{$ELSE} {$ELSE}
closedir(pdir(f.dirptr)); closedir(pdir(f.dirptr));
{$ENDIF} {$ENDIF}
Dispose(pdir(f.dirptr)^.buf);
Dispose(pdir(f.dirptr));
end; end;
End; End;
end; end;
@ -1046,7 +1046,10 @@ End.
{ {
$Log$ $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 * fixed getfattr which didn't reset doserror
Revision 1.10 1999/03/05 13:09:57 peter Revision 1.10 1999/03/05 13:09:57 peter

View File

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