Modified: trunk/darwinxref/plugins/exportIndex.c (846 => 847)
--- trunk/darwinxref/plugins/exportIndex.c 2010-06-23 16:36:33 UTC (rev 846)
+++ trunk/darwinxref/plugins/exportIndex.c 2010-06-23 22:17:33 UTC (rev 847)
@@ -44,19 +44,21 @@
CFStringRef arg = CFArrayGetValueAtIndex(argv, 0);
xml = CFEqual(arg, CFSTR("-xml"));
// -xml is the only supported option
- if (xml && count >= 2) {
+ if (xml && count == 2) {
build = CFArrayGetValueAtIndex(argv, 1);
- } else if (count == 1) {
+ } else if (!xml && count == 1) {
build = arg;
- } else {
- return -1;
}
}
CFPropertyListRef plist = DBCopyBuildPlist(build);
if (xml) {
- CFDataRef data = CFPropertyListCreateXMLData(NULL, plist);
- res = write(STDOUT_FILENO, CFDataGetBytePtr(data), CFDataGetLength(data));
+ CFDataRef data = CFPropertyListCreateData(kCFAllocatorDefault,
+ plist,
+ kCFPropertyListXMLFormat_v1_0,
+ 0,
+ NULL);
+ res = write(STDOUT_FILENO, CFDataGetBytePtr(data), CFDataGetLength(data));
} else {
res = writePlist(stdout, plist, 0);
}