git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: nori <semtlenori@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] http: fix charset detection of extract_content_type()
Date: Mon, 16 Jun 2014 11:29:39 -0700	[thread overview]
Message-ID: <xmqqha3kr9m4.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <539caff7.e7bc420a.76b9.fffff853@mx.google.com> (nori's message of "Sun, 15 Jun 2014 03:49:34 +0900")

nori <semtlenori@gmail.com> writes:

> extract_content_type() could not extract a charset parameter if the
> parameter is not the first one and there is a whitespace and a following
> semicolon just before the parameter. For example:
>
>     text/plain; format=fixed ;charset=utf-8
>
> Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
> ---

Peff, doesn't this look somehow familiar?  Perhaps with e3131626
(http: optionally extract charset parameter from content-type,
2014-05-22), this patch is unnecessary?

>  http.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/http.c b/http.c
> index 2b4f6a3..05e8b91 100644
> --- a/http.c
> +++ b/http.c
> @@ -971,7 +971,7 @@ static void extract_content_type(struct strbuf *raw, struct strbuf *type,
>  
>  	strbuf_reset(charset);
>  	while (*p) {
> -		while (isspace(*p))
> +		while (isspace(*p) || *p == ';')
>  			p++;
>  		if (!extract_param(p, "charset", charset))
>  			return;

  parent reply	other threads:[~2014-06-16 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 18:49 [PATCH] http: fix charset detection of extract_content_type() nori
2014-06-15  8:21 ` Yi EungJun
2014-06-16 18:29 ` Junio C Hamano [this message]
2014-06-16 19:20   ` Jeff King
2014-06-17  9:31 ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqha3kr9m4.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=semtlenori@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).