summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-05-09 04:50:57 +0000
committerAndreas Kling <kling@serenityos.org>2021-05-09 09:39:40 +0200
commit57c96ce50101db492679bae0eff49a401a16a24d (patch)
treedc8f7bac8db533b4763511cc060dbc772d7de29e /Userland/DevTools/UserspaceEmulator
parent3ab37674c615eea5ed8ba5926db543004ff312c2 (diff)
downloadserenity-57c96ce50101db492679bae0eff49a401a16a24d.zip
UserspaceEmulator: Allow running executables not in PATH
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp
index 4916edd6d8..e62239b71a 100644
--- a/Userland/DevTools/UserspaceEmulator/main.cpp
+++ b/Userland/DevTools/UserspaceEmulator/main.cpp
@@ -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;