mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 18:00:17 +02:00
FEXServerClient: Fix searching for FEXServer
argv[0] is whatever the user passed in and may not directly be FEXLoader/FEXInterpreter's path. Make sure get the full path.
This commit is contained in:
4 files changed
+23
-14
No files matched your search
@@ -220,7 +220,7 @@ int ConnectToServer(ConnectionOption ConnectionOption) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool SetupClient(char* InterpreterPath) {
|
||||
bool SetupClient(std::string_view InterpreterPath) {
|
||||
ServerFD = FEXServerClient::ConnectToAndStartServer(InterpreterPath);
|
||||
if (ServerFD == -1) {
|
||||
return false;
|
||||
@@ -238,7 +238,7 @@ bool SetupClient(char* InterpreterPath) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int ConnectToAndStartServer(char* InterpreterPath) {
|
||||
int ConnectToAndStartServer(std::string_view InterpreterPath) {
|
||||
int ServerFD = ConnectToServer(ConnectionOption::NoPrintConnectionError);
|
||||
if (ServerFD == -1) {
|
||||
// Couldn't connect to the server. Start one
|
||||
@@ -250,7 +250,7 @@ int ConnectToAndStartServer(char* InterpreterPath) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
fextl::string FEXServerPath = FHU::Filesystem::ParentPath(InterpreterPath) + "/FEXServer";
|
||||
fextl::string FEXServerPath = fextl::fmt::format("{}/FEXServer", InterpreterPath);
|
||||
// Check if a local FEXServer next to FEXInterpreter exists
|
||||
// If it does then it takes priority over the installed one
|
||||
if (!FHU::Filesystem::Exists(FEXServerPath)) {
|
||||
|
||||
Reference in new issue
Block a user