33 lines
914 B
Plaintext
33 lines
914 B
Plaintext
$OpenBSD: patch-src_interface_file_utils_cpp,v 1.2 2019/01/02 12:43:19 jca Exp $
|
|
Index: src/interface/file_utils.cpp
|
|
--- src/interface/file_utils.cpp.orig
|
|
+++ src/interface/file_utils.cpp
|
|
@@ -7,8 +7,8 @@
|
|
#include <wx/dynlib.h> // Used by GetDownloadDir
|
|
#include <knownfolders.h>
|
|
#else
|
|
+#include <glob.h>
|
|
#include <wx/textfile.h>
|
|
-#include <wordexp.h>
|
|
#endif
|
|
|
|
std::wstring GetAsURL(std::wstring const& dir)
|
|
@@ -359,12 +359,12 @@ wxString ShellUnescape(wxString const& path)
|
|
|
|
const wxWX2MBbuf buf = path.mb_str();
|
|
if (buf && *buf) {
|
|
- wordexp_t p;
|
|
- int res = wordexp(buf, &p, WRDE_NOCMD);
|
|
- if (!res && p.we_wordc == 1 && p.we_wordv) {
|
|
- ret = wxString(p.we_wordv[0], wxConvLocal);
|
|
+ glob_t p;
|
|
+ int res = glob( buf, GLOB_ERR, NULL, &p );
|
|
+ if( !res && p.gl_pathc == 1 && p.gl_pathv ) {
|
|
+ ret = wxString(p.gl_pathv[0], wxConvLocal);
|
|
}
|
|
- wordfree(&p);
|
|
+ globfree(&p);
|
|
}
|
|
return ret;
|
|
}
|