Commit 26e9f25a authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

reject utf-8 boms



... like qmake does

Change-Id: I0724d1981278d0e7c4d7b4d4cfa435adaf3622ee
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent b2017f42
......@@ -214,7 +214,15 @@ bool QMakeParser::read(ProFile *pro)
return false;
}
QString content(QString::fromLocal8Bit(file.readAll()));
QByteArray bcont = file.readAll();
if (bcont.startsWith(QByteArray("\xef\xbb\xbf"))) {
// UTF-8 BOM will cause subtle errors
m_handler->message(QMakeParserHandler::ParserIoError,
fL1S("Unexpected UTF-8 BOM in %1").arg(pro->fileName()));
return false;
}
QString content(QString::fromLocal8Bit(bcont));
bcont.clear();
file.close();
return read(pro, content, FullGrammar);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment