From: Thomas Rast Date: Mon, 20 Aug 2012 18:24:56 +0000 (+0200) Subject: gettext: do not translate empty string X-Git-Tag: v1.8.0-rc0~101^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c3a433f94d6809bd6c81ef3bd5c5315c844aa5d;p=git.git gettext: do not translate empty string The gettext .po files have a header, but it looks like the translation specification for an empty string. This results in _("") actually returning that header. Check the input to _() and do not call gettext() on an empty string; in some places, we run _(opts->help) where opts->help may be empty. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- diff --git a/gettext.h b/gettext.h index 57ba8bb02..376297bf7 100644 --- a/gettext.h +++ b/gettext.h @@ -44,6 +44,8 @@ extern int use_gettext_poison(void); static inline FORMAT_PRESERVING(1) const char *_(const char *msgid) { + if (!*msgid) + return ""; return use_gettext_poison() ? "# GETTEXT POISON #" : gettext(msgid); }