]> git.saurik.com Git - cydia.git/commitdiff
Filter empty strings from query terms.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 24 Mar 2011 14:27:28 +0000 (07:27 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 24 Mar 2011 14:27:28 +0000 (07:27 -0700)
MobileCydia.mm

index 8c01c675148711a95470154ea4edd4c1294fc3e9..6008a27b9bf098ae813755359cb7378e0b965f47 100644 (file)
@@ -7979,7 +7979,12 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
 }
 
 - (NSArray *) termsForQuery:(NSString *)query {
-    return [query componentsSeparatedByString:@" "];
+    NSMutableArray *terms([NSMutableArray arrayWithCapacity:2]);
+    for (NSString *component in [query componentsSeparatedByString:@" "])
+        if ([component length] != 0)
+            [terms addObject:component];
+
+    return terms;
 }
 
 - (void) useSearch {