Index: lxqt-session/src/lxqtmodman.cpp --- lxqt-session/src/lxqtmodman.cpp.orig +++ lxqt-session/src/lxqtmodman.cpp @@ -26,6 +26,10 @@ * * END_COMMON_COPYRIGHT_HEADER */ +#if defined(__OpenBSD__) +#define NO_WORDEXP +#endif + #include "lxqtmodman.h" #include #include @@ -43,7 +47,11 @@ #include #include "wmselectdialog.h" #include "windowmanager.h" +#ifdef NO_WORDEXP +#include +#else #include +#endif #include "log.h" #include @@ -429,6 +437,22 @@ bool LXQtModuleManager::nativeEventFilter(const QByteA void lxqt_setenv(const char *env, const QByteArray &value) { + #ifdef NO_WORDEXP + glob_t p; + glob(value.constData(), 0, NULL, &p); + if (p.gl_pathc == 1) + { + + qCDebug(SESSION) << "Environment variable" << env << "=" << p.gl_pathv[0]; + qputenv(env, p.gl_pathv[0]); + } + else + { + qCWarning(SESSION) << "Error expanding environment variable" << env << "=" << value; + qputenv(env, value); + } + globfree(&p); + #else wordexp_t p; wordexp(value.constData(), &p, 0); if (p.we_wordc == 1) @@ -443,6 +467,7 @@ void lxqt_setenv(const char *env, const QByteArray &va qputenv(env, value); } wordfree(&p); + #endif } void lxqt_setenv_prepend(const char *env, const QByteArray &value, const QByteArray &separator)