plasma5-workspace/0001-locations-runner-Fix-empty-list-on-invalid-shell-quo.patch
Fabian Vogt ae9ce836c0 Accepting request 874437 from home:Vogtinator:plasma5.21
- Add patch to fix krunner crash caused by mismatched quotes:
  * 0001-locations-runner-Fix-empty-list-on-invalid-shell-quo.patch

OBS-URL: https://build.opensuse.org/request/show/874437
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=573
2021-02-22 20:41:50 +00:00

33 lines
1.3 KiB
Diff

From 3a672ee43f48655ddcb544cc947680ba0aab7d2a Mon Sep 17 00:00:00 2001
From: Alexander Lohnau <alexander.lohnau@gmx.de>
Date: Mon, 22 Feb 2021 18:10:08 +0100
Subject: [PATCH] locations runner: Fix empty list on invalid shell quotes
---
runners/locations/locationrunner.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/runners/locations/locationrunner.cpp b/runners/locations/locationrunner.cpp
index 175c07023..d1edeef02 100644
--- a/runners/locations/locationrunner.cpp
+++ b/runners/locations/locationrunner.cpp
@@ -53,9 +53,12 @@ void LocationsRunner::match(Plasma::RunnerContext &context)
{
QString term = context.query();
// If we have a query with an executable and optionally arguments, BUG: 433053
- QFileInfo tmpInfo(KShell::tildeExpand(KShell::splitArgs(term).constFirst()));
- if (tmpInfo.isFile() && tmpInfo.isExecutable()) {
- return;
+ const QStringList split = KShell::splitArgs(term);
+ if (!split.isEmpty()) {
+ QFileInfo tmpInfo(KShell::tildeExpand(split.first()));
+ if (tmpInfo.isFile() && tmpInfo.isExecutable()) {
+ return;
+ }
}
// We want to expand ENV variables like $HOME to get the actual path, BUG: 358221
KUriFilter::self()->filterUri(term, {QStringLiteral("kshorturifilter")});
--
2.25.1