Fix dependency scanner being confused by UTF-8 BOM
Update QMakeSourceFileInfo::findDeps to skip UTF-8 BOM if exists. Task-number: QTBUG-34182 Change-Id: I7a3e30ecab08f485c53e2ca2eab197619b11c2c7 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
208f364a95
commit
96ff51f856
@ -554,7 +554,14 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
InCode // after directive, parsing non-#include directive or in actual code
|
||||
} cpp_state = AtStart;
|
||||
|
||||
for(int x = 0; x < buffer_len; ++x) {
|
||||
int x = 0;
|
||||
if (buffer_len >= 3) {
|
||||
const unsigned char *p = (unsigned char *)buffer;
|
||||
// skip UTF-8 BOM, if present
|
||||
if (p[0] == 0xEF && p[1] == 0xBB && p[2] == 0xBF)
|
||||
x += 3;
|
||||
}
|
||||
for (; x < buffer_len; ++x) {
|
||||
bool try_local = true;
|
||||
char *inc = 0;
|
||||
if(file->type == QMakeSourceFileInfo::TYPE_UI) {
|
||||
|
Loading…
Reference in New Issue
Block a user