search for linux backend plugins

- search for plugin in
  - working directory
  - binary directory
  - let linux search the plugins (libraries)
This commit is contained in:
psychocrypt
2017-11-01 21:12:32 +01:00
parent bc18ee3fd7
commit 14f041a971
3 changed files with 17 additions and 4 deletions
+8 -2
View File
@@ -106,15 +106,21 @@ int main(int argc, char *argv[])
using namespace xmrstak;
std::string pathWithName(argv[0]);
auto pos = pathWithName.rfind("/");
std::string seperator("/");
auto pos = pathWithName.rfind(seperator);
if(pos == std::string::npos)
{
// try windows "\"
pos = pathWithName.rfind("\\");
seperator = "\\";
pos = pathWithName.rfind(seperator);
}
params::inst().binaryName = std::string(pathWithName, pos + 1, std::string::npos);
if(params::inst().binaryName.compare(pathWithName) != 0)
{
params::inst().executablePrefix = std::string(pathWithName, 0, pos);
params::inst().executablePrefix += seperator;
}
bool userSetPasswd = false;
for(int i = 1; i < argc; ++i)