mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Search $PATH for command when creating SystemExec from command line
When creating a SystemExec from a command-line, search $PATH for the command to execute, so that post-export hooks don't need to specify a full path.
This commit is contained in:
parent
a245250409
commit
724a69a8d5
1 changed files with 11 additions and 2 deletions
|
|
@ -43,9 +43,12 @@
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <glibmm/miscutils.h>
|
||||||
|
|
||||||
#define USE_VFORK
|
#define USE_VFORK
|
||||||
|
|
||||||
|
#include "pbd/file_utils.h"
|
||||||
|
#include "pbd/search_path.h"
|
||||||
#include "pbd/system_exec.h"
|
#include "pbd/system_exec.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
@ -192,8 +195,14 @@ SystemExec::SystemExec (std::string command, const std::map<char, std::string> s
|
||||||
{
|
{
|
||||||
init ();
|
init ();
|
||||||
make_argp_escaped(command, subs);
|
make_argp_escaped(command, subs);
|
||||||
|
if (!find_file_in_search_path (Searchpath (Glib::getenv ("PATH")), argp[0], cmd)) {
|
||||||
|
// not found in path - use as-is
|
||||||
cmd = argp[0];
|
cmd = argp[0];
|
||||||
// cmd = strdup(argp[0]);
|
}
|
||||||
|
|
||||||
|
// Glib::find_program_in_path () is only available in Glib >= 2.28
|
||||||
|
// cmd = Glib::find_program_in_path (argp[0]);
|
||||||
|
|
||||||
make_envp();
|
make_envp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue