From c566c659516121d6d812791bc4839d021a6fb5c4 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Wed, 5 Mar 2025 11:19:19 -0800 Subject: [PATCH] Use parent_path for app bundle directory. --- UnleashedRecomp/os/macos/process_macos.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnleashedRecomp/os/macos/process_macos.cpp b/UnleashedRecomp/os/macos/process_macos.cpp index d8902cdd..a459dd90 100644 --- a/UnleashedRecomp/os/macos/process_macos.cpp +++ b/UnleashedRecomp/os/macos/process_macos.cpp @@ -50,7 +50,7 @@ static CFURLRef UntranslocateBundlePath(const CFURLRef bundlePath) std::filesystem::path os::process::GetExecutableRoot() { - std::filesystem::path appPath = GetExecutablePath(); + std::filesystem::path resultPath = GetExecutablePath().remove_filename(); if (CFBundleRef bundleRef = CFBundleGetMainBundle()) { if (CFURLRef bundleUrlRef = CFBundleCopyBundleURL(bundleRef)) @@ -66,7 +66,7 @@ std::filesystem::path os::process::GetExecutableRoot() untranslocatedUrlRef ? untranslocatedUrlRef : bundleUrlRef, true, reinterpret_cast(appBundlePath), sizeof(appBundlePath))) { - appPath = std::filesystem::path(appBundlePath); + resultPath = std::filesystem::path(appBundlePath).parent_path(); } if (untranslocatedUrlRef) @@ -76,7 +76,7 @@ std::filesystem::path os::process::GetExecutableRoot() CFRelease(bundleUrlRef); } } - return appPath.remove_filename(); + return resultPath; } std::filesystem::path os::process::GetWorkingDirectory()