From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] parseopt: do not translate empty help string
Date: Mon, 20 Aug 2012 20:24:56 +0200 [thread overview]
Message-ID: <bcb1f4437760452f967737fddf26dff019d0f0b2.1345487066.git.trast@student.ethz.ch> (raw)
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.
Prevent parseopt from passing empty strings to gettext when it
displays help about commands. In some instances it already did this,
but git-grep's --or etc. caught another case.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
parse-options.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parse-options.c b/parse-options.c
index c1c66bd..f95bbb2 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -562,7 +562,8 @@ static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
fputc('\n', outfile);
pad = USAGE_OPTS_WIDTH;
}
- fprintf(outfile, "%*s%s\n", pad + USAGE_GAP, "", _(opts->help));
+ fprintf(outfile, "%*s%s\n", pad + USAGE_GAP, "",
+ *opts->help ? _(opts->help) : "");
}
fputc('\n', outfile);
--
1.7.12.rc1.203.gc3c8071
next reply other threads:[~2012-08-20 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 18:24 Thomas Rast [this message]
2012-08-20 19:21 ` [PATCH] parseopt: do not translate empty help string Junio C Hamano
2012-08-20 20:10 ` Thomas Rast
2012-08-20 22:04 ` Junio C Hamano
2012-08-20 22:08 ` Junio C Hamano
2012-08-20 23:03 ` Thomas Rast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bcb1f4437760452f967737fddf26dff019d0f0b2.1345487066.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).