Browse Source

pasotjs: fixed parsing cfg

git-svn-id: trunk@40076 -
Mattias Gaertner 6 years ago
parent
commit
b5d1f1026f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/pastojs/src/pas2jscompiler.pp

+ 2 - 2
packages/pastojs/src/pas2jscompiler.pp

@@ -3006,13 +3006,13 @@ begin
       l:=length(Line);
       l:=length(Line);
       p:=1;
       p:=1;
       while (p<=l) and (Line[p] in [' ',#9]) do inc(p);
       while (p<=l) and (Line[p] in [' ',#9]) do inc(p);
-      if l>p then continue; // empty line
+      if p>l then continue; // empty line
 
 
       if (p<=l) and (Line[p]='#') then
       if (p<=l) and (Line[p]='#') then
       begin
       begin
         // cfg directive
         // cfg directive
         inc(p);
         inc(p);
-        if (p<=l) and (Line[p] in [#0,#9,' ','-']) then continue; // comment
+        if (p>l) or (Line[p] in [#0,#9,' ','-']) then continue; // comment
         Directive:=lowercase(GetWord);
         Directive:=lowercase(GetWord);
         case Directive of
         case Directive of
         'ifdef','ifndef':
         'ifdef','ifndef':