diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2012-02-25 13:57:56 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2012-02-25 13:58:07 -0800 |
commit | 5b625a2ec894f476ab8f7daae0e7471b1076aa80 (patch) | |
tree | dd17e14c54f0bdeab195dc8dbb1f723cbc40255d | |
parent | 174327c191b9c91b498e0645b22ff8a01defec58 (diff) |
Do not add nil tags to the Package::tag_ array.
-rw-r--r-- | MobileCydia.mm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index cdce7c5..2212e09 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2321,9 +2321,14 @@ struct PackageNameOrdering : pkgCache::TagIterator tag(iterator.TagList()); if (!tag.end()) { tags_ = [NSMutableArray arrayWithCapacity:8]; - do { + + goto tag; for (; !tag.end(); ++tag) tag: { const char *name(tag.Name()); - [tags_ addObject:[(NSString *)CYStringCreate(name) autorelease]]; + NSString *string((NSString *) CYStringCreate(name)); + if (string == nil) + continue; + + [tags_ addObject:[string autorelease]]; if (role_ == 0 && strncmp(name, "role::", 6) == 0 /*&& strcmp(name, "role::leaper") != 0*/) { if (strcmp(name + 6, "enduser") == 0) @@ -2344,9 +2349,7 @@ struct PackageNameOrdering : else if (strcmp(name + 7, "obsolete") == 0) obsolete_ = true; } - - ++tag; - } while (!tag.end()); + } } _end |