this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use file system representation CFString APIs in LS

Add note to use CFBundle instead of reading Info.plist directly

+7 -5
+7 -5
src/frameworks/CoreServices/src/LaunchServices/LaunchServices.c
··· 112 112 CFRelease(pre); 113 113 /* Launch the executable */ 114 114 executable = CFURLGetString(url_plus_exec); 115 - CFShow(executable); 115 + 116 116 /* Try to use CFBundleName first */ 117 117 if (bundleName == NULL) 118 118 bundleName = CFStringCreateCopy(kCFAllocatorDefault, executable); 119 - nameSize = CFStringGetLength(bundleName)+1; 119 + nameSize = CFStringGetMaximumSizeOfFileSystemRepresentation(bundleName); 120 120 name = malloc(nameSize); 121 - CFStringGetCString(bundleName, name, nameSize, kCFStringEncodingUTF8); 122 - execSize = CFStringGetLength(executable)+1; 121 + CFStringGetFileSystemRepresentation(bundleName, name, nameSize); 122 + execSize = CFStringGetMaximumSizeOfFileSystemRepresentation(executable); 123 123 exec = malloc(execSize); 124 - CFStringGetCString(executable, exec, execSize, kCFStringEncodingUTF8); 124 + CFStringGetFileSystemRepresentation(executable, exec, execSize); 125 125 argv[0] = exec; 126 126 argv[1] = NULL; 127 127 pid = spawn_via_launchd(name, (const char *const *)argv, NULL); ··· 148 148 CFReadStreamRef rs = CFReadStreamCreateWithFile(kCFAllocatorDefault, info_plist_url); 149 149 CFDictionaryRef info_plist; 150 150 CFStringRef ret = NULL; 151 + 152 + /* TODO: Simplify by using CFBundleGetInfoDictionary */ 151 153 152 154 *exec = NULL; 153 155 *bundleName = NULL;