X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fxparser.pas;h=f18ff98b8efae3fd042feb270b3e03f209a5e1b5;hb=987c4a835a103345b59937e8e1be8524a6228712;hp=de2dfb38a379ac52872a91caaffd71ac61a11db2;hpb=6880f8a491a247a34d6afb5508d0a64196a3d26d;p=d2df-sdl.git diff --git a/src/shared/xparser.pas b/src/shared/xparser.pas index de2dfb3..f18ff98 100644 --- a/src/shared/xparser.pas +++ b/src/shared/xparser.pas @@ -3,8 +3,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -306,6 +305,14 @@ begin mTokInt := 0; mOptions := aopts; skipToken(); + // fuck you, BOM! + { + if (mBufLen >= 3) and (mBuffer[0] = #$EF) and (mBuffer[1] = #$BB) and (mBuffer[2] = #$BF) then + begin + for f := 3 to mBufLen-1 do mBuffer[f-3] := mBuffer[f]; + Dec(mBufLen, 3); + end; + } end; @@ -426,6 +433,17 @@ function TTextParser.skipBlanks (): Boolean; var level: Integer; begin + //writeln('line=', mLine, '; col=', mCol, '; char0=', Integer(peekChar(0))); + if (mLine = 1) and (mCol = 1) and + (peekChar(0) = #$EF) and + (peekChar(1) = #$BB) and + (peekChar(2) = #$BF) then + begin + skipChar(); + skipChar(); + skipChar(); + end; + while (curChar <> #0) do begin if (curChar = '/') then