diff --git a/Incremental Store/.EncryptedStore.m.swp b/Incremental Store/.EncryptedStore.m.swp new file mode 100644 index 0000000..07c7b63 Binary files /dev/null and b/Incremental Store/.EncryptedStore.m.swp differ diff --git a/Incremental Store/EncryptedStore.m b/Incremental Store/EncryptedStore.m index aa7a382..e10b7fa 100755 --- a/Incremental Store/EncryptedStore.m +++ b/Incremental Store/EncryptedStore.m @@ -4189,8 +4189,15 @@ - (void)parseExpression:(NSExpression *)expression if (exprBinding) [*bindings addObject:exprBinding]; } - *operand = [NSString stringWithFormat:[operator objectForKey:@"format"], - [subOperands componentsJoinedByString:@","]]; + NSString *strFormat = [operator objectForKey:@"format"]; + NSMutableString *strOperands = [NSMutableString string]; + // Courtesy of Ruslan Soldatenko at https://stackoverflow.com/a/40638476 + NSArray *arrComponents = strFormat ? [strFormat componentsSeparatedByString:@"%@"] : @[@""]; + NSUInteger iterationCount = subOperands.count < arrComponents.count ? subOperands.count : arrComponents.count; + for ( NSUInteger i = 0; i < iterationCount; i++ ) + [strOperands appendFormat:@"%@%@", arrComponents[i], subOperands[i]]; + [strOperands appendString:[arrComponents lastObject]]; + *operand = iterationCount == 0 ? [strOperands stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] : strOperands; *bindings = [*bindings cmdFlatten]; }