int extNum;
int_32 tag;
int justOne;
+ int arrayCount;
char * format;
char * type;
int pad;
format[currToken].u.tag.format = start;
format[currToken].u.tag.pad = 0;
format[currToken].u.tag.justOne = 0;
+ format[currToken].u.tag.arrayCount = 0;
chptr = start;
while (*chptr && *chptr != '{') chptr++;
if (*start == '=') {
format[currToken].u.tag.justOne = 1;
start++;
+ } else if (*start == '#') {
+ format[currToken].u.tag.justOne = 1;
+ format[currToken].u.tag.arrayCount = 1;
+ start++;
}
next = start;
char * val = NULL;
char ** strarray;
int mayfree = 0;
+ int countBuf;
headerTagFormatFunction tagtype = NULL;
const struct headerSprintfExtension * ext;
mayfree = 1;
}
+ if (tag->arrayCount) {
+ if (type == RPM_STRING_ARRAY_TYPE) free(data);
+
+ countBuf = count;
+ data = &countBuf;
+ count = 1;
+ type = RPM_INT32_TYPE;
+ }
+
strcpy(buf, "%");
strcat(buf, tag->format);
case PTOK_TAG:
val = formatValue(&token->u.tag, h, extensions, extCache,
- token->u.tag.justOne ? 1 : element);
+ token->u.tag.justOne ? 0 : element);
break;
case PTOK_ARRAY:
numElements = -1;
for (i = 0; i < token->u.array.numTokens; i++) {
if (token->u.array.format[i].type != PTOK_TAG ||
+ token->u.array.format[i].u.tag.arrayCount ||
token->u.array.format[i].u.tag.justOne) continue;
if (token->u.array.format[i].u.tag.ext) {