UserspaceEmulator: Allow running executables not in PATH
This commit is contained in:
parent
3ab37674c6
commit
57c96ce501
Notes:
sideshowbarker
2024-07-18 18:28:14 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/57c96ce5010 Pull-request: https://github.com/SerenityOS/serenity/pull/6977 Issue: https://github.com/SerenityOS/serenity/issues/6952
1 changed files with 6 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <pthread.h>
|
||||
#include <serenity.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]);
|
||||
if (executable_path.is_empty()) {
|
||||
reportln("Cannot find executable for '{}'.", command[0]);
|
||||
return 1;
|
||||
executable_path = Core::File::real_path_for(command[0]);
|
||||
if (executable_path.is_empty()) {
|
||||
reportln("Cannot find executable for '{}'.", executable_path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Vector<String> arguments;
|
||||
|
|
Loading…
Add table
Reference in a new issue