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
|
var
|
||||||
LineColCount: Integer;
|
LineColCount: Integer;
|
||||||
begin
|
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
|
if EndOfFile then
|
||||||
Exit(False);
|
Exit(False);
|
||||||
|
|
||||||
// Handle line ending
|
// Handle line ending
|
||||||
if EndOfLine then
|
if EndOfLine then
|
||||||
begin
|
begin
|
||||||
// Having read the previous line, adjust column count if necessary:
|
|
||||||
LineColCount := FCurrentCol + 1;
|
|
||||||
if LineColCount > FMaxColCount then
|
|
||||||
FMaxColCount := LineColCount;
|
|
||||||
|
|
||||||
SkipEndOfLine;
|
SkipEndOfLine;
|
||||||
if EndOfFile then
|
if EndOfFile then
|
||||||
Exit(False);
|
Exit(False);
|
||||||
|
Reference in New Issue
Block a user