}
if (!table && !entry) {
- if (!lang) {
+ if (!lang || (lang[0] == 'C' && lang[1] == '\0')) {
charArray[0] = "C";
if (!headerAddEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE,
&charArray, 1)) return 0;
}
if (!entry) {
- strArray = alloca(sizeof(*strArray) * langNum);
+ strArray = alloca(sizeof(*strArray) * (langNum + 1));
for (i = 0; i < langNum; i++)
strArray[i] = "";
strArray[langNum] = string;
int headerAddEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c);
int headerModifyEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c);
-/* For the C locale, lang should be *NULL*. Here are the rules:
-
+/* A NULL lang is interpreted as the C locale. Here are the rules:
+
1) If the tag isn't in the Header, it's added with the passed string
as a version.
2) If the tag occurs multiple times in entry, which tag is affected