aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHein-Pieter van Braam2017-02-17 19:24:42 +0100
committerHein-Pieter van Braam2017-02-18 12:41:26 +0100
commitd0c2015fe11f920874661ec24c518aa36c99b470 (patch)
tree4f07fa3085b92d13a766e42a4b0105615e8949ff
parent9a5442a22630e346df44a3df6bc1bbbd03c787dd (diff)
downloadgodot-d0c2015fe11f920874661ec24c518aa36c99b470.tar.gz
godot-d0c2015fe11f920874661ec24c518aa36c99b470.tar.zst
godot-d0c2015fe11f920874661ec24c518aa36c99b470.zip
-rw-r--r--platform/x11/godot_x11.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index f85ba1702..b727ecbd1 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -26,6 +26,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#include <unistd.h>
+#include <limits.h>
+
#include "main/main.h"
#include "os_x11.h"
@@ -33,6 +36,9 @@ int main(int argc, char* argv[]) {
OS_X11 os;
+ char *cwd = (char*)malloc(PATH_MAX);
+ getcwd(cwd, PATH_MAX);
+
Error err = Main::setup(argv[0],argc-1,&argv[1]);
if (err!=OK)
return 255;
@@ -41,5 +47,8 @@ int main(int argc, char* argv[]) {
os.run(); // it is actually the OS that decides how to run
Main::cleanup();
+ chdir(cwd);
+ free(cwd);
+
return os.get_exit_code();
}