From fa7d1ba879ea825076f42b99077d6326517b1bf3 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 28 Jun 2024 12:50:30 +0200 Subject: [PATCH] Allow empty lines in opkg_commands. --- UpdatePTUDevCtrl/worker.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/UpdatePTUDevCtrl/worker.cpp b/UpdatePTUDevCtrl/worker.cpp index be8b38d..edb2e57 100644 --- a/UpdatePTUDevCtrl/worker.cpp +++ b/UpdatePTUDevCtrl/worker.cpp @@ -880,10 +880,12 @@ bool Worker::execOpkgCommands() { while (!in.atEnd()) { QString line = in.readLine(); // TODO: "^\\s*[#]{0,}$" : empty line or comment line starting with # - static const QRegularExpression comment("^\\s*#.*$"); - if (line.indexOf(comment, 0) == -1) { - // found opkg command + static const QRegularExpression comment("^\\s*[#].*$"); + static const QRegularExpression emptyLine("^\\s*$"); + if (line.indexOf(emptyLine, 0) == -1 && + line.indexOf(comment, 0) == -1) { QString opkgCommand = line.trimmed(); + qCritical() << "Found opkg-command" << opkgCommand; if (!executeOpkgCommand(opkgCommand)) { opkgErrorLst << opkgCommand; } else {