summaryrefslogtreecommitdiff
path: root/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-05-16 19:21:28 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-05-19 20:17:10 +0430
commitcbd76e053194f34b2738ed9ecc264e79c8152cfb (patch)
tree0da765e1e23973e0be3c7a12a75f588b7465a406 /Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch
parent6eb071cd0d1e5c454b188dca6ba60260966779fe (diff)
downloadserenity-cbd76e053194f34b2738ed9ecc264e79c8152cfb.zip
Ports: Update Super-Mario's patches to use git patches
Diffstat (limited to 'Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch')
-rw-r--r--Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch b/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch
new file mode 100644
index 0000000000..f487089377
--- /dev/null
+++ b/Ports/Super-Mario/patches/0001-chdir-to-the-installed-directory-before-execution.patch
@@ -0,0 +1,37 @@
+From c7869092a313c1550a34675d1c9faebc1468ef1e Mon Sep 17 00:00:00 2001
+From: Gunnar Beutner <gbeutner@serenityos.org>
+Date: Fri, 4 Jun 2021 00:29:36 +0200
+Subject: [PATCH 1/5] chdir() to the installed directory before execution
+
+The game expects its assets in the current directory, but we install
+those to /opt/Super_Mario, so chdir() there at program startup to avoid
+crashing.
+---
+ src/main.cpp | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.cpp b/src/main.cpp
+index 040eb56..ca14d6f 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -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;
+ }
+--
+2.36.1
+