From 3dfa753c835903c9ac8e350dcdd866773db61a42 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 22 Jun 2007 11:12:25 +0000 Subject: [PATCH] rpmdb/header.c (guess_category_value): Allow overriding locale using $RPM_LANGUAGE_I18NSTRING for headerFindI18NString We want to abuse I18NSTRING for storing arbitrary data, e.g. GIT commit identifiers. To achieve this, we have to bypass setlocale(3) check. --- rpmdb/header.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpmdb/header.c b/rpmdb/header.c index aad8581..90aac32 100644 --- a/rpmdb/header.c +++ b/rpmdb/header.c @@ -1367,6 +1367,10 @@ guess_category_value (int category) const char *language; const char *retval; + language = getenv ("RPM_LANGUAGE_I18NSTRING"); + if (language && *language) + return language; + /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently selected locale is the C locale. This is a GNU extension. */