mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 03:38:26 +02:00
IDE: fixed crash during converting .rst file
git-svn-id: trunk@10494 -
This commit is contained in:
parent
e707c31119
commit
571a55ad60
@ -213,10 +213,13 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
try
|
try
|
||||||
fs:=TFileStream.Create(InFilename,fmOpenRead);
|
fs:=TFileStream.Create(InFilename,fmOpenRead);
|
||||||
SetLength(s,fs.Size);
|
try
|
||||||
if s='' then exit;
|
SetLength(s,fs.Size);
|
||||||
fs.Read(s[1],length(s));
|
if s='' then exit;
|
||||||
fs.Free;
|
fs.Read(s[1],length(s));
|
||||||
|
finally
|
||||||
|
fs.Free;
|
||||||
|
end;
|
||||||
NextLineStartPos:=1;
|
NextLineStartPos:=1;
|
||||||
|
|
||||||
while NextLineStartPos<=length(s) do begin
|
while NextLineStartPos<=length(s) do begin
|
||||||
@ -267,6 +270,9 @@ begin
|
|||||||
|
|
||||||
Result:=true;
|
Result:=true;
|
||||||
except
|
except
|
||||||
|
on E: Exception do begin
|
||||||
|
DebugLn(['ReadRSTFile InFilename="',InFilename,'" Error=',E.Message]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -422,7 +428,7 @@ begin
|
|||||||
OldContent:=TMemoryStream.Create;
|
OldContent:=TMemoryStream.Create;
|
||||||
OldContent.LoadFromFile(OutFilename);
|
OldContent.LoadFromFile(OutFilename);
|
||||||
ContentChanged:=CompareMemStreamText(NewContent,OldContent);
|
ContentChanged:=CompareMemStreamText(NewContent,OldContent);
|
||||||
OldContent.Free;
|
FreeAndNil(OldContent);
|
||||||
end else begin
|
end else begin
|
||||||
ContentChanged:=true;
|
ContentChanged:=true;
|
||||||
end;
|
end;
|
||||||
@ -435,6 +441,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
on E: Exception do begin
|
on E: Exception do begin
|
||||||
|
DumpExceptionBackTrace;
|
||||||
DebugLn(['ConvertToGettextPO ',E.Message]);
|
DebugLn(['ConvertToGettextPO ',E.Message]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user