Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b99dbe9a authored by Elliott Hughes's avatar Elliott Hughes Committed by Android Git Automerger
Browse files

am 4c2aec09: am aa3e17e1: Merge "Return path including executable instead of without"

* commit '4c2aec09':
  Return path including executable instead of without
parents 330c3ee9 4c2aec09
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -20,11 +20,11 @@
void get_my_path(char *s, size_t maxLen)
{
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
    CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
    CFRelease(bundleURL);
    CFURLRef executableURL = CFBundleCopyExecutableURL(mainBundle);
    CFStringRef executablePathString = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
    CFRelease(executableURL);

    CFStringGetCString(bundlePathString, s, maxLen, kCFStringEncodingASCII);
    CFRelease(bundlePathString);
    CFStringGetCString(executablePathString, s, maxLen, kCFStringEncodingASCII);
    CFRelease(executablePathString);
}
+5 −5
Original line number Diff line number Diff line
@@ -32,12 +32,12 @@
void get_my_path(char s[PATH_MAX])
{
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
    CFStringRef bundlePathString = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
    CFRelease(bundleURL);
    CFURLRef executableURL = CFBundleCopyExecutableURL(mainBundle);
    CFStringRef executablePathString = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
    CFRelease(executableURL);

    CFStringGetCString(bundlePathString, s, PATH_MAX - 1, kCFStringEncodingASCII);
    CFRelease(bundlePathString);
    CFStringGetCString(executablePathString, s, PATH_MAX-1, kCFStringEncodingASCII);
    CFRelease(executablePathString);

	char *x;
    x = strrchr(s, '/');