From: Junio C Hamano <gitster@pobox.com>
To: Ralf Thielow <ralf.thielow@gmail.com>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
git@vger.kernel.org,
"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Re: [PATCH] macos: lazily initialize iconv
Date: Tue, 31 Jul 2012 11:19:49 -0700 [thread overview]
Message-ID: <7v6293kd2y.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAN0XMOL6m0B0bLwdp9mviOLqYORGcnf9LMS5=+WkXhGinBrzgA@mail.gmail.com> (Ralf Thielow's message of "Tue, 31 Jul 2012 20:10:49 +0200")
Ralf Thielow <ralf.thielow@gmail.com> writes:
> On Tue, Jul 31, 2012 at 7:52 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> + /* Avoid iconv_open()/iconv_close() if there is nothing to convert */
>> + for (i = 0; i < argc; i++) {
>> + if (has_utf8(argv[i], (size_t)-1, NULL))
>> + break;
>> + }
>> + if (i < argc)
>> + return;
>> +
>
> I'm not very familiar with this code but:
>
> before: it reencodes everything which is utf-8 in argv
> after: it reencodes *nothing* if one string in argv is not in utf-8
>
> am i wrong?
You are right. It should avoid the whole iconv thing if we saw _no_
utf8, i.e. the last two should be:
if (argc <= i)
return;
Thanks.
next prev parent reply other threads:[~2012-07-31 18:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 17:52 [PATCH] macos: lazily initialize iconv Junio C Hamano
2012-07-31 18:07 ` Junio C Hamano
2012-07-31 18:10 ` Ralf Thielow
2012-07-31 18:19 ` Junio C Hamano [this message]
2012-07-31 18:37 ` [PATCH v2] " Junio C Hamano
2012-07-31 18:55 ` Ralf Thielow
2012-07-31 19:00 ` Junio C Hamano
2012-07-31 19:51 ` Linus Torvalds
2012-07-31 20:16 ` Junio C Hamano
2012-07-31 20:39 ` Linus Torvalds
2012-08-01 19:25 ` Torsten Bögershausen
2012-08-10 16:43 ` Torsten Bögershausen
2012-08-10 18:18 ` Junio C Hamano
2012-08-10 21:11 ` Torsten Bögershausen
2012-08-10 21:47 ` Junio C Hamano
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=7v6293kd2y.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ralf.thielow@gmail.com \
--cc=tboegi@web.de \
--cc=torvalds@linux-foundation.org \
/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).