diff --git a/tools/osx/xcode_locator.m b/tools/osx/xcode_locator.m index 9d449e1893df9f..ed2ef87453ff8c 100644 --- a/tools/osx/xcode_locator.m +++ b/tools/osx/xcode_locator.m @@ -233,10 +233,12 @@ static void DumpAsJson( FILE *output, NSMutableDictionary *dict) { fprintf(output, "{\n"); + int i = 0; for (NSString *version in dict) { XcodeVersionEntry *entry = dict[version]; - fprintf(output, "\t\"%s\": \"%s\",\n", - version.UTF8String, entry.url.fileSystemRepresentation); + fprintf(output, "\t\"%s\": \"%s\"%s\n", + version.UTF8String, entry.url.fileSystemRepresentation, + ++i == [dict count] ? "" : ","); } fprintf(output, "}\n"); }