From 7fedc2057030e46e1421fa5d14278c2d7bc49a87 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 17 May 2008 09:50:39 +0300 Subject: [PATCH] Add HEADERGET_RAW flag to disable i18n lookups --- lib/header.c | 22 +++++++++++++--------- lib/header.h | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/header.c b/lib/header.c index 973466e96..1c1643621 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1359,16 +1359,20 @@ static int intGetTdEntry(Header h, rpmTag tag, rpmtd td, headerGetFlags flags) return 0; } - switch (entry->info.type) { - case RPM_I18NSTRING_TYPE: - rc = 1; - td->type = RPM_STRING_TYPE; - td->count = 1; - td->data = headerFindI18NString(h, entry); - break; - default: + if (flags & HEADERGET_RAW) { rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM)); - break; + } else { + switch (entry->info.type) { + case RPM_I18NSTRING_TYPE: + rc = 1; + td->type = RPM_STRING_TYPE; + td->count = 1; + td->data = headerFindI18NString(h, entry); + break; + default: + rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM)); + break; + } } /* XXX 1 on success */ diff --git a/lib/header.h b/lib/header.h index cba315717..14e0d0fee 100644 --- a/lib/header.h +++ b/lib/header.h @@ -183,6 +183,7 @@ typedef enum headerGetFlags_e { HEADERGET_DEFAULT = 0, HEADERGET_MINMEM = (1 << 0), /* string pointers refer to header memory */ HEADERGET_EXT = (1 << 1), /* lookup extension types too */ + HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */ } headerGetFlags; /** \ingroup header