Przeglądaj źródła

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

git-svn-id: trunk@8975 -
florian 18 lat temu
rodzic
commit
036744bc16
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 4 0
      ide/whtml.pas
  2. 2 2
      ide/whtmlhlp.pas

+ 4 - 0
ide/whtml.pas

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

+ 2 - 2
ide/whtmlhlp.pas

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