csvdocument: fixed incorrect MaxColCount calculation in TCSVParser if line with most cols is immediately followed by EOF

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2519 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
vvzh
2012-09-18 21:55:00 +00:00
parent df456d9d1a
commit b06f7759b9

View File

@ -463,17 +463,20 @@ function TCSVParser.ParseNextCell: Boolean;
var
LineColCount: Integer;
begin
if EndOfLine or EndOfFile then
begin
// Having read the previous line, adjust column count if necessary:
LineColCount := FCurrentCol + 1;
if LineColCount > FMaxColCount then
FMaxColCount := LineColCount;
end;
if EndOfFile then
Exit(False);
// Handle line ending
if EndOfLine then
begin
// Having read the previous line, adjust column count if necessary:
LineColCount := FCurrentCol + 1;
if LineColCount > FMaxColCount then
FMaxColCount := LineColCount;
SkipEndOfLine;
if EndOfFile then
Exit(False);