Index: src/core/util_string.cpp
--- src/core/util_string.cpp.orig
+++ src/core/util_string.cpp
@@ -570,18 +570,26 @@ t_CKBOOL extract_args( const string & token,
 //-----------------------------------------------------------------------------
 #if !defined(__PLATFORM_WINDOWS__) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) && !defined(__CHIP_MODE__)
 
+#include <glob.h>
+#if !defined(__OpenBSD__) && !defined(__NetBSD__)
 #include <wordexp.h>
+#endif
 //-----------------------------------------------------------------------------
 // name: expandTildePath()
 // desc: expand ~ path, does not care whether path is valid or not
 //-----------------------------------------------------------------------------
 std::string expandTildePath( const std::string & path )
 {
+    std::string exp;
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+    // wordexp not available; use glob with GLOB_TILDE for tilde expansion
+    glob_t g;
+    if( glob(path.c_str(), GLOB_TILDE | GLOB_NOCHECK, NULL, &g) == 0 && g.gl_pathc > 0 )
+        exp = g.gl_pathv[0];
+    globfree( &g );
+#else
     // wordexp result
     wordexp_t we;
-    // the result
-    std::string exp;
-
     // "perform shell-style word expansions"
     if( wordexp(path.c_str(), &we, 0 ) == 0 ) // success
     {
@@ -594,7 +602,7 @@ std::string expandTildePath( const std::string & path 
         // free up
         wordfree( &we );
     }
-
+#endif
     // if still empty for any reason, default to original
     if( exp == "" ) exp = path;
 
