From: Jonathan Nieder <jrnieder@gmail.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð" <avarab@gmail.com>,
"Jiang Xin" <worldhello.net@gmail.com>
Subject: Re: [PATCH i18n 01/11] Add three convenient format printing functions with \n automatically appended
Date: Mon, 16 Apr 2012 12:26:54 -0500 [thread overview]
Message-ID: <20120416172654.GU5813@burratino> (raw)
In-Reply-To: <1334580603-11577-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
> printf("hello world\n");
>
> can be converted to
>
> printf_ln(_("hello world"));
Fun.
[...]
> --- a/strbuf.c
> +++ b/strbuf.c
> @@ -464,3 +464,36 @@ void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,
[...]
> +int printf_ln(const char *fmt, ...)
> +{
> + int ret;
> + va_list ap;
> + va_start(ap, fmt);
> + ret = vprintf(fmt, ap);
> + va_end(ap);
> + if (ret >= 0)
> + ret += printf("\n");
What happens if the second printf fails?
next prev parent reply other threads:[~2012-04-16 17:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 12:49 [PATCH i18n 00/11] Mark more strings for translation Nguyễn Thái Ngọc Duy
2012-04-16 12:49 ` [PATCH i18n 01/11] Add three convenient format printing functions with \n automatically appended Nguyễn Thái Ngọc Duy
2012-04-16 17:26 ` Jonathan Nieder [this message]
2012-04-17 8:12 ` Erik Faye-Lund
2012-04-16 12:49 ` [PATCH i18n 02/11] i18n: mark relative dates for translation Nguyễn Thái Ngọc Duy
2012-04-16 12:49 ` [PATCH i18n 03/11] i18n: parseopt: lookup help and argument translations when showing usage Nguyễn Thái Ngọc Duy
2012-04-16 17:54 ` Jonathan Nieder
2012-04-16 23:35 ` Jonathan Nieder
2012-04-16 12:49 ` [PATCH i18n 04/11] i18n: help: mark parseopt strings for translation Nguyễn Thái Ngọc Duy
2012-04-16 12:49 ` [PATCH i18n 05/11] i18n: help: mark " Nguyễn Thái Ngọc Duy
2012-04-18 19:30 ` Jonathan Nieder
2012-04-16 12:49 ` [PATCH i18n 06/11] i18n: make warn_dangling_symref() automatically append \n Nguyễn Thái Ngọc Duy
2012-04-16 12:49 ` [PATCH i18n 07/11] i18n: remote: mark strings for translation Nguyễn Thái Ngọc Duy
2012-04-16 12:50 ` [PATCH i18n 08/11] i18n: apply: " Nguyễn Thái Ngọc Duy
2012-04-16 12:50 ` [PATCH i18n 09/11] i18n: apply: update say_patch_name to give translators complete sentence Nguyễn Thái Ngọc Duy
2012-04-22 16:42 ` Zbigniew Jędrzejewski-Szmek
2012-04-23 11:33 ` Nguyen Thai Ngoc Duy
2012-04-16 12:50 ` [PATCH i18n 10/11] i18n: index-pack: mark strings for translation Nguyễn Thái Ngọc Duy
2012-04-16 12:50 ` [PATCH i18n 11/11] i18n: bundle: " Nguyễn Thái Ngọc Duy
2012-04-18 19:40 ` [PATCH i18n 00/11] Mark more " Jonathan Nieder
2012-04-22 3:24 ` Nguyen Thai Ngoc Duy
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=20120416172654.GU5813@burratino \
--to=jrnieder@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=worldhello.net@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).