1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 12:47:34 +00:00

UserspaceEmulator: Allow running executables not in PATH

This commit is contained in:
Brendan Coles 2021-05-09 04:50:57 +00:00 committed by Andreas Kling
parent 3ab37674c6
commit 57c96ce501

View file

@ -10,6 +10,7 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibCore/ArgsParser.h> #include <LibCore/ArgsParser.h>
#include <LibCore/DirIterator.h> #include <LibCore/DirIterator.h>
#include <LibCore/File.h>
#include <pthread.h> #include <pthread.h>
#include <serenity.h> #include <serenity.h>
#include <string.h> #include <string.h>
@ -27,8 +28,11 @@ int main(int argc, char** argv, char** env)
auto executable_path = Core::find_executable_in_path(command[0]); auto executable_path = Core::find_executable_in_path(command[0]);
if (executable_path.is_empty()) { if (executable_path.is_empty()) {
reportln("Cannot find executable for '{}'.", command[0]); executable_path = Core::File::real_path_for(command[0]);
return 1; if (executable_path.is_empty()) {
reportln("Cannot find executable for '{}'.", executable_path);
return 1;
}
} }
Vector<String> arguments; Vector<String> arguments;