$OpenBSD: patch-src_libide_io_ide-path_c,v 1.2 2019/11/02 14:27:40 ajacoutot Exp $

wordexp(3) vomit

Index: src/libide/io/ide-path.c
--- src/libide/io/ide-path.c.orig
+++ src/libide/io/ide-path.c
@@ -24,7 +24,11 @@
 
 #include <string.h>
 #include <unistd.h>
+#if !defined(__OpenBSD__)
 #include <wordexp.h>
+#else
+#include <glob.h>
+#endif
 
 #include <libide-threading.h>
 
@@ -42,6 +46,7 @@
  *
  * Since: 3.32
  */
+#if !defined(__OpenBSD__)
 gchar *
 ide_path_expand (const gchar *path)
 {
@@ -66,6 +71,33 @@ ide_path_expand (const gchar *path)
 
   return ret;
 }
+#else
+gchar *
+ide_path_expand (const gchar *path)
+{
+  glob_t state;
+  gchar *ret = NULL;
+  int r;
+
+  if (path == NULL)
+    return NULL;
+
+  r = glob (path, GLOB_ERR, NULL, &state);
+  if(r == 0 && state.gl_pathc == 1 && state.gl_pathv) {
+    ret = g_strdup (state.gl_pathv[0]);
+  }
+  globfree(&state);
+
+  if (!g_path_is_absolute (ret))
+    {
+      g_autofree gchar *freeme = ret;
+
+      ret = g_build_filename (g_get_home_dir (), freeme, NULL);
+    }
+
+  return ret;
+}
+#endif
 
 /**
  * ide_path_collapse:
