mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-10 06:41:42 +02:00
Use "which" instead of "whereis" to find the streaming executable.
This commit is contained in:
parent
2ba365b1a1
commit
e355a559eb
1 changed files with 5 additions and 9 deletions
|
@ -62,14 +62,10 @@ std::string ProcessStream::findExe(const std::string& filename)
|
||||||
if (exe.find("/") != string::npos)
|
if (exe.find("/") != string::npos)
|
||||||
exe = exe.substr(exe.find_last_of("/") + 1);
|
exe = exe.substr(exe.find_last_of("/") + 1);
|
||||||
|
|
||||||
/// check with "whereis"
|
/// check with "which"
|
||||||
string whereis = execGetOutput("whereis " + exe);
|
string which = execGetOutput("which " + exe);
|
||||||
if (whereis.find(":") != std::string::npos)
|
if (!which.empty())
|
||||||
{
|
return which;
|
||||||
whereis = trim_copy(whereis.substr(whereis.find(":") + 1));
|
|
||||||
if (!whereis.empty())
|
|
||||||
return whereis;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// check in the same path as this binary
|
/// check in the same path as this binary
|
||||||
char buff[PATH_MAX];
|
char buff[PATH_MAX];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue