summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-04 00:29:36 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-04 09:38:25 +0200
commit8c18c7e4c2c7a356721e8cf8613e5a7ec3e5d8d6 (patch)
treef6e470b490bc2a291106cea02941d657e8de7411 /Ports
parent19c4e74f7048288808a97b3a74bce10877b78767 (diff)
downloadserenity-8c18c7e4c2c7a356721e8cf8613e5a7ec3e5d8d6.zip
Ports: Don't crash when starting uMario outside of /opt/Super_Mario
Previously this port would just crash. There was a workaround in the way the app launcher started the game but I'd really like to get rid of that hack.
Diffstat (limited to 'Ports')
-rw-r--r--Ports/Super-Mario/patches/cwd.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/Ports/Super-Mario/patches/cwd.patch b/Ports/Super-Mario/patches/cwd.patch
new file mode 100644
index 0000000000..57abed06b5
--- /dev/null
+++ b/Ports/Super-Mario/patches/cwd.patch
@@ -0,0 +1,21 @@
+diff -Naur Super-Mario-Clone-Cpp-master/src/main.cpp Super-Mario-Clone-Cpp-master.serenity/src/main.cpp
+--- Super-Mario-Clone-Cpp-master/src/main.cpp 2019-08-01 15:39:15.000000000 +0200
++++ Super-Mario-Clone-Cpp-master.serenity/src/main.cpp 2021-06-03 23:54:26.881221759 +0200
+@@ -1,10 +1,15 @@
+ #include "header.h"
+ #include "Core.h"
++#include <unistd.h>
+
+ int main(int argc, const char* argv[]) {
+- CCore oCore;
++ chdir("/opt/Super_Mario");
+
+- oCore.mainLoop();
++ {
++ CCore oCore;
++
++ oCore.mainLoop();
++ }
+
+ return 0;
+ }