From befe62d4d3e966f170bb4964c2e4f034adc3ee3b Mon Sep 17 00:00:00 2001 From: Swasti Shrivastava <37058682+swasti16@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:49:16 +0530 Subject: [PATCH] Fix #13014: GUI: wrong misra command if misra rule texts is specified (#6695) --- gui/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 32af92baad2..0a4c1fe6f81 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1006,11 +1006,13 @@ QString MainWindow::loadAddon(Settings &settings, const QString &filesDir, const const QString misraFile = fromNativePath(mSettings->value(SETTINGS_MISRA_FILE).toString()); if (!misraFile.isEmpty()) { QString arg; + picojson::array arr; if (misraFile.endsWith(".pdf", Qt::CaseInsensitive)) arg = "--misra-pdf=" + misraFile; else arg = "--rule-texts=" + misraFile; - obj["args"] = picojson::value(arg.toStdString()); + arr.emplace_back(arg.toStdString()); + obj["args"] = picojson::value(arr); } }