openbsd-ports/net/filezilla/patches/patch-src_commonui_fz_paths_cpp

31 lines
680 B
Plaintext

Index: src/commonui/fz_paths.cpp
--- src/commonui/fz_paths.cpp.orig
+++ src/commonui/fz_paths.cpp
@@ -15,7 +15,7 @@
#include <objbase.h>
#else
#include <unistd.h>
- #include <wordexp.h>
+ #include <glob.h>
#endif
using namespace std::literals;
@@ -491,12 +491,12 @@ std::string ShellUnescape(std::string const& path)
{
std::string ret;
- wordexp_t p;
- int res = wordexp(path.c_str(), &p, WRDE_NOCMD);
- if (!res && p.we_wordc == 1 && p.we_wordv) {
- ret = p.we_wordv[0];
+ glob_t p;
+ int res = glob( path.c_str(), GLOB_ERR, NULL, &p );
+ if( !res && p.gl_pathc == 1 && p.gl_pathv ) {
+ ret = p.gl_pathv[0];
}
- wordfree(&p);
+ globfree(&p);
return ret;
}