Revert changes to readCIncbin
This commit is contained in:
parent
495532c032
commit
e710567400
1 changed files with 6 additions and 6 deletions
|
@ -263,14 +263,14 @@ QString ParseUtil::readCIncbin(const QString &filename, const QString &label) {
|
||||||
|
|
||||||
this->text = readTextFile(this->root + "/" + filename);
|
this->text = readTextFile(this->root + "/" + filename);
|
||||||
|
|
||||||
int start = this->text.indexOf(QRegularExpression(label + "\b"));
|
QRegularExpression re(QString(
|
||||||
if (start < 0) return path;
|
"\\b%1\\b"
|
||||||
int end = this->text.indexOf(';', start);
|
"\\s*\\[?\\s*\\]?\\s*=\\s*"
|
||||||
QString incbinText = this->text.mid(start, end - start);
|
"INCBIN_[US][0-9][0-9]?"
|
||||||
|
"\\(\\s*\"([^\"]*)\"\\s*\\)").arg(label));
|
||||||
|
|
||||||
static const QRegularExpression re_incbin("\\s*\\[?\\s*\\]?\\s*=\\s*INCBIN_[US][0-9][0-9]?\\(\\s*\\\"(?<path>[^\\\"]*)\\\"\\s*\\)");
|
|
||||||
QRegularExpressionMatch match;
|
QRegularExpressionMatch match;
|
||||||
qsizetype pos = incbinText.indexOf(re_incbin, 0, &match);
|
qsizetype pos = this->text.indexOf(re, 0, &match);
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
path = match.captured(1);
|
path = match.captured(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue