patch-src_interface_file_utils_cpp 934 B

1234567891011121314151617181920212223242526272829303132
  1. $OpenBSD: patch-src_interface_file_utils_cpp,v 1.1 2014/07/12 12:42:55 giovanni Exp $
  2. --- src/interface/file_utils.cpp.orig Thu May 1 21:29:19 2014
  3. +++ src/interface/file_utils.cpp Fri Jul 11 12:06:55 2014
  4. @@ -6,8 +6,8 @@
  5. #ifdef __WXMSW__
  6. #include <wx/dynlib.h> // Used by GetDownloadDir
  7. #else
  8. +#include <glob.h>
  9. #include <wx/textfile.h>
  10. -#include <wordexp.h>
  11. #endif //__WXMSW__
  12. wxString GetAsURL(const wxString& dir)
  13. @@ -334,12 +334,12 @@ wxString ShellUnescape( wxString const& path )
  14. const wxWX2MBbuf buf = path.mb_str();
  15. if( buf && *buf ) {
  16. - wordexp_t p;
  17. - int res = wordexp( buf, &p, WRDE_NOCMD );
  18. - if( !res && p.we_wordc == 1 && p.we_wordv ) {
  19. - ret = wxString(p.we_wordv[0], wxConvLocal);
  20. + glob_t p;
  21. + int res = glob( buf, GLOB_ERR, NULL, &p );
  22. + if( !res && p.gl_pathc == 1 && p.gl_pathv ) {
  23. + ret = wxString(p.gl_pathv[0], wxConvLocal);
  24. }
  25. - wordfree(&p);
  26. + globfree(&p);
  27. }
  28. return ret;
  29. }