From e71056740002a54d9ac7685c9c8e83d853792ffd Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 6 Feb 2023 19:19:46 -0500 Subject: [PATCH] Revert changes to readCIncbin --- src/core/parseutil.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index 2e7faa34..a421a087 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -263,14 +263,14 @@ QString ParseUtil::readCIncbin(const QString &filename, const QString &label) { this->text = readTextFile(this->root + "/" + filename); - int start = this->text.indexOf(QRegularExpression(label + "\b")); - if (start < 0) return path; - int end = this->text.indexOf(';', start); - QString incbinText = this->text.mid(start, end - start); + QRegularExpression re(QString( + "\\b%1\\b" + "\\s*\\[?\\s*\\]?\\s*=\\s*" + "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*\\\"(?[^\\\"]*)\\\"\\s*\\)"); QRegularExpressionMatch match; - qsizetype pos = incbinText.indexOf(re_incbin, 0, &match); + qsizetype pos = this->text.indexOf(re, 0, &match); if (pos != -1) { path = match.captured(1); }