git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] http: fix charset detection of extract_content_type()
@ 2014-06-14 18:49 nori
  2014-06-15  8:21 ` Yi EungJun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: nori @ 2014-06-14 18:49 UTC (permalink / 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-17  9:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-06-16 19:20   ` Jeff King
2014-06-17  9:31 ` Jeff King

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).