$OpenBSD$

Index: src/utils/system.cc
--- src/utils/system.cc.orig
+++ src/utils/system.cc
@@ -17,7 +17,11 @@
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
+#if defined(__OpenBSD__)
+#include <glob.h>
+#else
 #include <wordexp.h>
+#endif
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -119,6 +123,15 @@ std::string get_path(const std::string& file) {
 std::list<std::string> expandEnv(const std::string& var, int flags) {
     std::list<std::string> vars;
 
+#if defined(__OpenBSD__)
+    glob_t p;
+    if (glob(var.c_str(), GLOB_ERR | GLOB_TILDE, NULL, &p) == 0) {
+        if (p.gl_pathc == 1 && p.gl_pathv) {
+            vars.push_back(p.gl_pathv[0]);
+	}
+	globfree(&p);
+    }
+#else
     wordexp_t p;
     if (wordexp(var.c_str(), &p, flags) == false) {
         if (p.we_wordc) {
@@ -133,6 +146,8 @@ std::list<std::string> expandEnv(const std::string& va
         }
         wordfree(&p);
     }
+
+#endif
     return vars;
 }
 
