Skip to content

Commit

Permalink
SQL Script read beyond EOF: http://github.com/hgourvest/uib/issues/10
Browse files Browse the repository at this point in the history
  • Loading branch information
Arioch authored and Arioch committed Mar 16, 2017
1 parent 8a20c20 commit 22a841e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/uibsqlparser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,19 @@ function TUIBSQLParser.GetStatement: string;
end;

function TUIBSQLParser.NextLine: boolean;
var iNextLine: integer;
begin
inc(FLine);
result := (FLine < FStrings.Count);
if result then
iNextLine := Succ(FLine);
Result := (iNextLine < FStrings.Count);
if Result then
begin
FLine := iNextLine;
FStr := FStrings[FLine];
FCursor := PChar(FStr);
end;
end;

// simple grammar analyser method
// simple grammar analyzer method
function TUIBSQLParser.NextStatement: TSQLStatement;
var
LastTock: TSQLToken;
Expand Down

0 comments on commit 22a841e

Please sign in to comment.