Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Incremental Store/.EncryptedStore.m.swp
Binary file not shown.
11 changes: 9 additions & 2 deletions Incremental Store/EncryptedStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down