SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
38
x11/lxqt/liblxqt/patches/patch-lxqtprogramfinder_cpp
Normal file
38
x11/lxqt/liblxqt/patches/patch-lxqtprogramfinder_cpp
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue