diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index 3ae57d09fb..1843043ea5 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -34,8 +34,11 @@ #endif #ifdef PLATFORM_WINDOWS - #include - #include +# include +# include +#else +# include +# include #endif bool @@ -66,13 +69,20 @@ PBD::open_uri (const char* uri) while (s.find("\"") != std::string::npos) s.replace(s.find("\\"), 1, "\\\""); +#ifdef NO_VFORK std::string command = "xdg-open "; command += '"' + s + '"'; command += " &"; (void) system (command.c_str()); - - return true; +#else + if (::vfork () == 0) { + ::execlp ("xdg-open", "xdg-open", s.c_str(), (char*)NULL); + exit (0); + } #endif + +#endif /* not PLATFORM_WINDOWS and not __APPLE__ */ + return true; } bool