mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Fix update being installed before app terminates if it's located in NFC unicode encoded path (#2943)
Normalize the path on both sides (NSRunningApplication and path on disk) consistently using URLByResolvingSymlinksInPath.
This commit is contained in:
1 parent
6cf88c720d
commit
bd355af936
1 file changed
+5
-2
@@ -195,8 +195,11 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
|
||||
|
||||
- (NSArray<NSRunningApplication *> *)runningApplicationsWithBundle:(NSBundle *)bundle SPU_OBJC_DIRECT
|
||||
{
|
||||
// Resolve symlinks otherwise when we compare file paths, we may not realize two paths that are represented differently are the same
|
||||
NSArray<NSString *> *bundlePathComponents = bundle.bundlePath.stringByResolvingSymlinksInPath.pathComponents;
|
||||
// Resolve symlinks otherwise when we compare file paths, we may not realize two paths that are represented differently are the same.
|
||||
// Make sure to use -[NSURL URLByResolvingSymlinksInPath] rather than -[NSString stringByResolvingSymlinksInPath]
|
||||
// because the former will normalize it to proper file system representation.
|
||||
// This is also done when retrieving NSRunningApplication path further below
|
||||
NSArray<NSString *> *bundlePathComponents = bundle.bundleURL.URLByResolvingSymlinksInPath.pathComponents;
|
||||
NSString *bundleIdentifier = bundle.bundleIdentifier;
|
||||
|
||||
NSMutableArray<NSRunningApplication *> *matchedRunningApplications = [[NSMutableArray alloc] init];
|
||||
|
||||
Reference in new issue
Block a user