git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: nori <semtlenori@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Subject: [PATCH] http: fix charset detection of extract_content_type()
Date: Sun, 15 Jun 2014 03:49:34 +0900	[thread overview]
Message-ID: <539caff7.e7bc420a.76b9.fffff853@mx.google.com> (raw)

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>
---
 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;
-- 
2.0.0.422.gb6302de

             reply	other threads:[~2014-06-14 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 18:49 nori [this message]
2014-06-15  8:21 ` [PATCH] http: fix charset detection of extract_content_type() Yi EungJun
2014-06-16 18:29 ` Junio C Hamano
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=539caff7.e7bc420a.76b9.fffff853@mx.google.com \
    --to=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).