Browse Source

* Make sure BOM marker is correctly compared

Michaël Van Canneyt 3 months ago
parent
commit
628d035b50
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/objpas/classes/parser.inc

+ 3 - 1
rtl/objpas/classes/parser.inc

@@ -127,6 +127,8 @@ begin
 end;
 end;
 
 
 procedure TParser.SkipBOM;
 procedure TParser.SkipBOM;
+const
+  sbom : string[3] = #$EF#$BB#$BF;
 var
 var
   i : integer;
   i : integer;
   bom : string[3];
   bom : string[3];
@@ -142,7 +144,7 @@ begin
     CheckLoadBuffer;
     CheckLoadBuffer;
     inc(i);
     inc(i);
   end;
   end;
-  if (bom<>(#$EF+#$BB+#$BF)) then
+  if (bom<>sBom) then
     fPos:=backup;
     fPos:=backup;
 end;
 end;