diff --git a/ShadowsocksX-NG/ProxyConfHelper.m b/ShadowsocksX-NG/ProxyConfHelper.m index 09d4708..fdcbfab 100644 --- a/ShadowsocksX-NG/ProxyConfHelper.m +++ b/ShadowsocksX-NG/ProxyConfHelper.m @@ -119,11 +119,12 @@ GCDWebServer *webServer =nil; NSString* rawExceptions = [defaults stringForKey:@"ProxyExceptions"]; if (rawExceptions) { - NSCharacterSet* seps = [NSCharacterSet characterSetWithCharactersInString:@", 、"]; NSCharacterSet* whites = [NSCharacterSet whitespaceAndNewlineCharacterSet]; + NSMutableCharacterSet* seps = [NSMutableCharacterSet characterSetWithCharactersInString:@",、"]; + [seps formUnionWithCharacterSet:whites]; + NSArray* exceptions = [rawExceptions componentsSeparatedByCharactersInSet:seps]; - for (NSString* rawDomainOrHost in exceptions) { - NSString* domainOrHost = [rawDomainOrHost stringByTrimmingCharactersInSet:whites]; + for (NSString* domainOrHost in exceptions) { if ([domainOrHost length] > 0) { [args addObject:@"-x"]; [args addObject:domainOrHost];