IDE: fixed range check in updating po file from Vincent

git-svn-id: trunk@16183 -
This commit is contained in:
mattias 2008-08-22 13:23:36 +00:00
parent 106a0ad6cf
commit 4c807adbc8

View File

@ -261,10 +261,12 @@ begin
BasePOFile.UpdateStrings(InputLines, stRst); BasePOFile.UpdateStrings(InputLines, stRst);
except except
E := EPOFileError.Create(''); on Ex: Exception do begin
E.ResFileName:=FileName; E := EPOFileError.Create(Ex.Message);
E.POFileName:=POFileName; E.ResFileName:=FileName;
raise E; E.POFileName:=POFileName;
raise E;
end;
end; end;
end; end;
@ -282,10 +284,12 @@ begin
try try
POFile.SaveToFile(InputLines[i]); POFile.SaveToFile(InputLines[i]);
except except
E := EPOFileError.Create(''); on Ex: Exception do begin
E.ResFileName:=InputLines[i]; E := EPOFileError.Create(Ex.Message);
E.POFileName:=POFileName; E.ResFileName:=InputLines[i];
raise E; E.POFileName:=POFileName;
raise E;
end;
end; end;
finally finally
POFile.Free; POFile.Free;
@ -732,7 +736,7 @@ begin
while (p<=n)and(Line[p] in ['0'..'9']) do while (p<=n)and(Line[p] in ['0'..'9']) do
inc(p); inc(p);
UStr := UStr + Chr(StrToInt(copy(Line, j, p-j))); UStr := UStr + Chr(StrToInt(copy(Line, j, p-j)));
until (Line[p]<>'#') or (p>=n); until (p>n) or (Line[p]<>'#');
// transfer valid UTF-8 segments to result string // transfer valid UTF-8 segments to result string
// and re-encode back the rest // and re-encode back the rest
while Ustr<>'' do begin while Ustr<>'' do begin