mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-09 10:18:58 +02:00
* don't open error file twice but close it first if necessary
git-svn-id: trunk@5340 -
This commit is contained in:
parent
2162f63def
commit
d80bfc692d
@ -145,12 +145,19 @@ var
|
|||||||
|
|
||||||
procedure SetRedirectFile(const fn:string);
|
procedure SetRedirectFile(const fn:string);
|
||||||
begin
|
begin
|
||||||
|
{ close old redirection file because FileRedirection is handled in both passes }
|
||||||
|
if status.use_redir then
|
||||||
|
close(status.redirfile);
|
||||||
|
|
||||||
assign(status.redirfile,fn);
|
assign(status.redirfile,fn);
|
||||||
{$I-}
|
{$I-}
|
||||||
append(status.redirfile);
|
append(status.redirfile);
|
||||||
if ioresult <> 0 then
|
if ioresult <> 0 then
|
||||||
rewrite(status.redirfile);
|
begin
|
||||||
{$I+}
|
assign(status.redirfile,fn);
|
||||||
|
rewrite(status.redirfile);
|
||||||
|
end;
|
||||||
|
{$I+}
|
||||||
status.use_redir:=(ioresult=0);
|
status.use_redir:=(ioresult=0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user