SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,38 @@
Index: lxqtprogramfinder.cpp
--- lxqtprogramfinder.cpp.orig
+++ lxqtprogramfinder.cpp
@@ -22,8 +22,16 @@
*
* END_COMMON_COPYRIGHT_HEADER */
+#if defined(__OpenBSD__)
+#define NO_WORDEXP
+#endif
+
#include "lxqtprogramfinder.h"
+#ifdef NO_WORDEXP
+#include <glob.h>
+#else
#include <wordexp.h>
+#endif
#include <QDir>
#include <QFileInfo>
@@ -60,9 +68,17 @@ LXQT_API QStringList ProgramFinder::findPrograms(const
LXQT_API QString ProgramFinder::programName(const QString& command)
{
+ #ifdef NO_WORDEXP
+ glob_t we;
+ if (glob(command.toLocal8Bit().constData(), GLOB_ERR, NULL, &we) == 0)
+ if (we.gl_pathc > 0)
+ return QString::fromLocal8Bit(we.gl_pathv[0]);
+ return QString();
+ #else
wordexp_t we;
if (wordexp(command.toLocal8Bit().constData(), &we, WRDE_NOCMD) == 0)
if (we.we_wordc > 0)
return QString::fromLocal8Bit(we.we_wordv[0]);
return QString();
+ #endif
}