From c57b38d53c6de672ac4dd2165c74c76fa48c6ebc Mon Sep 17 00:00:00 2001 From: ROllerozxa Date: Mon, 29 Apr 2024 00:01:49 +0200 Subject: [PATCH] Check for data in `../share/principia/` on Windows too --- src/tms/backends/windows/main.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tms/backends/windows/main.cc b/src/tms/backends/windows/main.cc index 10a5b66e..237b28f7 100644 --- a/src/tms/backends/windows/main.cc +++ b/src/tms/backends/windows/main.cc @@ -171,8 +171,14 @@ WinMain(HINSTANCE hi, HINSTANCE hp, LPSTR cl, int cs) // How about now? if (stat("data-shared", &st) != 0) { - // We're doomed, better just fail. - tms_fatalf("Could not find data directories."); + // If that doesn't work we're assuming a system install. + tms_infof("chdirring to ./share/principia/"); + chdir("./share/principia/"); + + if (stat("data-shared", &st) != 0) { + // We're doomed, better just fail. + tms_fatalf("Could not find data directories."); + } } } else { // Switch to portable if ./portable.txt exists next to exe