allow /path/to/file.cpp:123:123 paths

allow that no trailing : is behind the column

BUG: 501004
This commit is contained in:
Christoph Cullmann
2025-03-23 19:45:47 +01:00
parent b83680a693
commit f8036be745

View File

@@ -77,9 +77,9 @@ void FileFilterHotSpot::activate(QObject *)
// Output of e.g.:
// - grep with line numbers: "path/to/some/file:123:"
// grep with long lines e.g. "path/to/some/file:123:void blah" i.e. no space after 123:
// - compiler errors with line/column numbers: "/path/to/file.cpp:123:123:"
// - compiler errors with line/column numbers: "/path/to/file.cpp:123:123:" or "/path/to/file.cpp:123:123"
// - ctest failing unit tests: "/path/to/file(204)"
static const QRegularExpression re(QStringLiteral(R"foo([:\(](\d+)(?:\)\])?(?::(\d+):|:[^\d]*)?$)foo"));
static const QRegularExpression re(QStringLiteral(R"foo([:\(](\d+)(?:\)\])?(?::(\d+):?|:[^\d]*)?$)foo"));
const QRegularExpressionMatch match = re.match(_filePath);
if (match.hasMatch()) {
// The file path without the ":123" ... etc part