From 8496bd030a07c6e7e61985a93f24bf23430fb525 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 15 Aug 2015 17:03:06 -0400 Subject: [PATCH] Minor SUHost.m improvements --- Sparkle/SUHost.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 0bc94909..5bb73ac9 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -89,7 +89,8 @@ if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) { // We'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name. NSString *normalizedAppPath = [[[self.bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [self.bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[self.bundle bundlePath] pathExtension]]]; - if (![[NSFileManager defaultManager] fileExistsAtPath:[[[self.bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [self.bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[self.bundle bundlePath] pathExtension]]]]) { + + if (![[NSFileManager defaultManager] fileExistsAtPath:normalizedAppPath]) { return normalizedAppPath; } } @@ -157,7 +158,7 @@ { struct statfs statfs_info; statfs([[self.bundle bundlePath] fileSystemRepresentation], &statfs_info); - return (statfs_info.f_flags & MNT_RDONLY); + return (statfs_info.f_flags & MNT_RDONLY) != 0; } - (BOOL)isBackgroundApplication