ICU-11537 genrb write .res formatVersion 2 if it would default to 3 without benefit: without sharing pool bundle string values

X-SVN-Rev: 37736
This commit is contained in:
Markus Scherer 2015-08-07 21:05:32 +00:00
parent 9e0d7d9554
commit 00ae09aa36

View file

@ -465,6 +465,10 @@ main(int argc,
p += length + 1;
remaining -= length + 1;
} while (remaining > 0);
if (poolBundle.fStrings->fCount == 0) {
delete poolBundle.fStrings;
poolBundle.fStrings = NULL;
}
}
T_FileStream_close(poolFile);
@ -477,6 +481,16 @@ main(int argc,
}
}
if(!options[FORMAT_VERSION].doesOccur && getFormatVersion() == 3 &&
poolBundle.fStrings == NULL &&
!options[WRITE_POOL_BUNDLE].doesOccur) {
// If we just default to formatVersion 3
// but there are no pool bundle strings to share
// and we do not write a pool bundle,
// then write formatVersion 2 which is just as good.
setFormatVersion(2);
}
if(options[INCLUDE_UNIHAN_COLL].doesOccur) {
puts("genrb option --includeUnihanColl ignored: \n"
"CLDR 26/ICU 54 unihan data is small, except\n"