From: Junio C Hamano Date: Mon, 20 Aug 2012 22:04:28 GMT Subject: Re: [PATCH] parseopt: do not translate empty help string Message-ID: <7vzk5pi5jn.fsf@alter.siamese.dyndns.org> In-Reply-To: <87obm5jpdy.fsf@thomas.inf.ethz.ch> Thomas Rast writes: > Junio C Hamano writes: > >> Thomas Rast writes: >> >>> 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. >> >> Thanks; this is a tricky bit to catch and makes me wonder where else >> we have a similar breakage. >> >> Perhaps we would want to do this instead? I dunno. >> >> gettext.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git i/gettext.h w/gettext.h >> index 57ba8bb..376297b 100644 >> --- i/gettext.h >> +++ w/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); >> } > > Oh, I forgot that we actually had a wrapper instead of the usual _. > Yes, I think that would be the better solution to guard against this. OK, then let's replace the patch text of your commit ;-).