39 lines
960 B
Text
39 lines
960 B
Text
|
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
|
||
|
}
|