summarylogtreecommitdiffstats
path: root/cwd.patch
diff options
context:
space:
mode:
authorNathaniel Cook2019-06-10 11:03:08 -0600
committerNathaniel Cook2019-06-10 11:03:08 -0600
commit5eb27bec7dc225cd6b381209e093b3e5cc10a36c (patch)
tree8c60f14407f3af278413ebecd09d4b713c592cd5 /cwd.patch
downloadaur-opensprinkler-git.tar.gz
add inital build files
Diffstat (limited to 'cwd.patch')
-rw-r--r--cwd.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/cwd.patch b/cwd.patch
new file mode 100644
index 000000000000..e9191ba49880
--- /dev/null
+++ b/cwd.patch
@@ -0,0 +1,30 @@
+--- utils.cpp 2017-09-16 18:05:05.050328507 +0000
++++ utils.cpp 2017-09-16 18:22:49.796658537 +0000
+@@ -271,6 +271,7 @@
+ char* get_runtime_path() {
+ static char path[PATH_MAX];
+ static byte query = 1;
++ int len;
+
+ #ifdef __APPLE__
+ strcpy(path, "./");
+@@ -278,15 +279,12 @@
+ #endif
+
+ if(query) {
+- if(readlink("/proc/self/exe", path, PATH_MAX ) <= 0) {
++ len = readlink("/proc/self/cwd", path, PATH_MAX);
++ if (len <= 0) {
+ return NULL;
+ }
+- char* path_end = strrchr(path, '/');
+- if(path_end == NULL) {
+- return NULL;
+- }
+- path_end++;
+- *path_end=0;
++ path[len] = '/';
++ path[len+1] = '\0';
+ query = 0;
+ }
+ return path;