* open html properly on read only file systems, resolves #10015

git-svn-id: trunk@8975 -
This commit is contained in:
florian 2007-10-28 18:50:10 +00:00
parent c3475dddc0
commit 036744bc16
2 changed files with 6 additions and 2 deletions

View File

@ -200,12 +200,16 @@ constructor TDOSTextFile.Init(AFileName: string);
var f: file;
linecomplete,hasCR: boolean;
S: string;
OldFMode : Integer;
begin
inherited Init;
if AFileName='' then Fail;
{$I-}
Assign(f,AFileName);
OldFMode:= FileMode;
FileMode:= 0;
Reset(f,1);
FileMode:= OldFMode;
if IOResult<>0 then Fail;
DosFileName:=AFileName;
Dispose(Lines,Done);

View File

@ -867,7 +867,7 @@ begin
exists PM }
src:=DirAndNameOf(src)+'.ans';
{$ifdef DEBUG}
DebugMessage(GetFileName,' Trying "'+Src+'"',Line,1);
DebugMessage(GetFileName,' Trying "'+Src+'"',Line,1);
{$endif DEBUG}
if not ExistsFile(src) then
begin
@ -1443,7 +1443,7 @@ begin
if Name<>'' then
HTMLFile:=New(PDOSTextFile, Init(Name));
if (HTMLFile=nil)and (CurFileName<>'') then
if (HTMLFile=nil) and (CurFileName<>'') then
begin
Name:=CurFileName;
HTMLFile:=New(PDOSTextFile, Init(Name));