]> git.saurik.com Git - uikittools.git/commitdiff
Move error case to before main code.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 6 Feb 2013 10:08:17 +0000 (10:08 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 6 Feb 2013 10:12:47 +0000 (10:12 +0000)
uicache.mm

index 020ec8e0c6be8746236a514c2080e0baf1314327..1b62d0e6fb1e49190f99b36b133e1e7b01280090 100644 (file)
@@ -106,8 +106,10 @@ int main(int argc, const char *argv[]) {
         NSMutableDictionary *bundles([NSMutableDictionary dictionaryWithCapacity:16]);
 
         id system = [cache objectForKey:@"System"];
-        if (system == nil)
-            goto error;
+        if (system == nil) { error:
+            fprintf(stderr, "%s\n", error == nil ? strerror(errno) : [[error localizedDescription] UTF8String]);
+            goto cached;
+        }
 
         [system removeAllObjects];
 
@@ -147,10 +149,8 @@ int main(int argc, const char *argv[]) {
                 [workspace registerApplication:[NSURL fileURLWithPath:path]];
             }
         }
-
-        if (false) error:
-            fprintf(stderr, "%s\n", error == nil ? strerror(errno) : [[error localizedDescription] UTF8String]);
     } else fprintf(stderr, "cannot open cache file. incorrect user?\n");
+  cached:
 
     if (respring || kCFCoreFoundationVersionNumber >= 550.32) {
         unlink([[NSString stringWithFormat:@"%@/Library/Caches/com.apple.springboard-imagecache-icons", home] UTF8String]);