mirror of https://gitee.com/bigwinds/arangodb
if the process to spawn doesn't contain a path, do a lookup in the host path for it. (#5127)
This commit is contained in:
parent
6053056b6a
commit
ef6a294a3b
|
@ -336,6 +336,19 @@ static char* makeWindowsArgs(ExternalProcess* external) {
|
|||
if (buf == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (( external->_executable.find('/') == std::string::npos) &&
|
||||
( external->_executable.find('\\') == std::string::npos)) {
|
||||
// oK, this is a binary without path, start the lookup.
|
||||
char buf[MAX_PATH];
|
||||
char *pBuf;
|
||||
DWORD n;
|
||||
n = SearchPath(nullptr, external->_executable.c_str(), nullptr, MAX_PATH, buf, &pBuf);
|
||||
if (n > 0) {
|
||||
external->_executable = std::string(buf, n);
|
||||
}
|
||||
}
|
||||
|
||||
TRI_ReserveStringBuffer(buf, 1024);
|
||||
err = appendQuotedArg(buf, external->_executable.c_str());
|
||||
if (err != TRI_ERROR_NO_ERROR) {
|
||||
|
|
Loading…
Reference in New Issue