diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-18 15:22:46 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-18 15:22:46 +0300 |
commit | 96470400712b6f8d68c906751f2d8df934c34bba (patch) | |
tree | e2c7189ee4f49a1d6457737e27ba4fa055d543c4 /lib/header.c | |
parent | efe4e4c9461ef3a1b253a5bcb628882bc0b21ee3 (diff) | |
download | rpm-96470400712b6f8d68c906751f2d8df934c34bba.tar.gz rpm-96470400712b6f8d68c906751f2d8df934c34bba.tar.bz2 rpm-96470400712b6f8d68c906751f2d8df934c34bba.zip |
Convert headerAddI18NString() to use headerPut()
Diffstat (limited to 'lib/header.c')
-rw-r--r-- | lib/header.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/header.c b/lib/header.c index ac43b30d7..0c3665117 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1603,14 +1603,20 @@ int headerAddI18NString(Header h, rpmTag tag, const char * string, if (!table && !entry) { const char * charArray[2]; rpm_count_t count = 0; + struct rpmtd_s td; if (!lang || (lang[0] == 'C' && lang[1] == '\0')) { charArray[count++] = "C"; } else { charArray[count++] = "C"; charArray[count++] = lang; } - if (!headerAddEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE, - &charArray, count)) + + rpmtdReset(&td); + td.tag = HEADER_I18NTABLE; + td.type = RPM_STRING_ARRAY_TYPE; + td.data = (void *) charArray; + td.count = count; + if (!headerPut(h, &td, HEADERPUT_DEFAULT)) return 0; table = findEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE); } @@ -1642,11 +1648,18 @@ int headerAddI18NString(Header h, rpmTag tag, const char * string, if (!entry) { int rc; + struct rpmtd_s td; strArray = xmalloc(sizeof(*strArray) * (langNum + 1)); for (i = 0; i < langNum; i++) strArray[i] = ""; strArray[langNum] = string; - rc = headerAddEntry(h, tag, RPM_I18NSTRING_TYPE, strArray, langNum + 1); + + rpmtdReset(&td); + td.tag = tag; + td.type = RPM_I18NSTRING_TYPE; + td.data = strArray; + td.count = langNum + 1; + rc = headerPut(h, &td, HEADERPUT_DEFAULT); free(strArray); return rc; } else if (langNum >= entry->info.count) { |