You've already forked lazarus-ccr
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user