Commit 688ba09c authored by Junio C Hamano's avatar Junio C Hamano

Merge branch 'ks/maint-1.6.0-mailinfo-folded' into maint-1.6.0

* ks/maint-1.6.0-mailinfo-folded:
  mailinfo: tests for RFC2047 examples
  mailinfo: add explicit test for mails like '<[email protected]> (A U Thor)'
  mailinfo: 'From:' header should be unfold as well
  mailinfo: correctly handle multiline 'Subject:' header
parents 3e186ef1 c32815f9
......@@ -430,13 +430,6 @@ static struct strbuf *decode_b_segment(const struct strbuf *b_seg)
c -= 'a' - 26;
else if ('0' <= c && c <= '9')
c -= '0' - 52;
else if (c == '=') {
/* padding is almost like (c == 0), except we do
* not output NUL resulting only from it;
* for now we just trust the data.
*/
c = 0;
}
else
continue; /* garbage */
switch (pos++) {
......@@ -514,7 +507,25 @@ static int decode_header_bq(struct strbuf *it)
rfc2047 = 1;
if (in != ep) {
strbuf_add(&outbuf, in, ep - in);
/*
* We are about to process an encoded-word
* that begins at ep, but there is something
* before the encoded word.
*/
char *scan;
for (scan = in; scan < ep; scan++)
if (!isspace(*scan))
break;
if (scan != ep || in == it->buf) {
/*
* We should not lose that "something",
* unless we have just processed an
* encoded-word, and there is only LWS
* before the one we are about to process.
*/
strbuf_add(&outbuf, in, ep - in);
}
in = ep;
}
/* E.g.
......@@ -860,6 +871,7 @@ static void handle_info(void)
}
output_header_lines(fout, "Subject", hdr);
} else if (!memcmp(header[i], "From", 4)) {
cleanup_space(hdr);
handle_from(hdr);
fprintf(fout, "Author: %s\n", name.buf);
fprintf(fout, "Email: %s\n", email.buf);
......
......@@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
'git mailsplit -o. ../t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
test `cat last` = 11'
test `cat last` = 13'
for mail in `echo 00*`
do
......@@ -25,6 +25,28 @@ do
diff ../t5100/info$mail info$mail"
done
test_expect_success 'split box with rfc2047 samples' \
'mkdir rfc2047 &&
git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
>rfc2047/last &&
last=`cat rfc2047/last` &&
echo total is $last &&
test `cat rfc2047/last` = 11'
for mail in `echo rfc2047/00*`
do
test_expect_success "mailinfo $mail" '
git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
echo msg &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-msg &&
echo patch &&
test_cmp "$TEST_DIRECTORY"/t5100/empty $mail-patch &&
echo info &&
test_cmp "$TEST_DIRECTORY"/t5100/rfc2047-info-$(basename $mail) $mail-info
'
done
test_expect_success 'respect NULs' '
git mailsplit -d3 -o. ../t5100/nul-plain &&
......
Author: Dmitriy Blinov
Email: [email protected]
Subject: Изменён список пакетов необходимых для сборки
Date: Wed, 12 Nov 2008 17:54:41 +0300
Author: A U Thor
Email: [email protected]
Subject: a patch
Date: Fri, 9 Jun 2006 00:44:16 -0700
textlive-* исправлены на texlive-*
docutils заменён на python-docutils
Действительно, оказалось, что rest2web вытягивает за собой
python-docutils. В то время как сам rest2web не нужен.
Signed-off-by: Dmitriy Blinov <[email protected]>
---
howto/build_navy.txt | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/howto/build_navy.txt b/howto/build_navy.txt
index 3fd3afb..0ee807e 100644
--- a/howto/build_navy.txt
+++ b/howto/build_navy.txt
@@ -119,8 +119,8 @@
- libxv-dev
- libusplash-dev
- latex-make
- - textlive-lang-cyrillic
- - textlive-latex-extra
+ - texlive-lang-cyrillic
+ - texlive-latex-extra
- dia
- python-pyrex
- libtool
@@ -128,7 +128,7 @@
- sox
- cython
- imagemagick
- - docutils
+ - python-docutils
#. на машине dinar: добавить свой открытый ssh-ключ в authorized_keys2 пользователя ddev
#. на своей машине: отредактировать /etc/sudoers (команда ``visudo``) примерно следующим образом::
--
1.5.6.5
Author: Keith Moore
Email: [email protected]
Subject: If you can read this you understand the example.
Author: Olle Järnefors
Email: [email protected]
Subject: Time for ISO 10646?
Author: Patrik Fältström
Email: [email protected]
Subject: RFC-HDR care and feeding
Author: Nathaniel Borenstein (םולש ןב ילטפנ)
Email: [email protected]
Subject: Test of new header generator
From nobody Mon Sep 17 00:00:00 2001
From: =?US-ASCII?Q?Keith_Moore?= <[email protected]>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <[email protected]>
CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <[email protected]>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
From nobody Mon Sep 17 00:00:00 2001
From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <[email protected]>
To: [email protected], [email protected]
Subject: Time for ISO 10646?
From nobody Mon Sep 17 00:00:00 2001
To: Dave Crocker <[email protected]>
Cc: [email protected], [email protected]
From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <[email protected]>
Subject: Re: RFC-HDR care and feeding
From nobody Mon Sep 17 00:00:00 2001
From: Nathaniel Borenstein <[email protected]>
(=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
To: Greg Vaudreuil <[email protected]>, Ned Freed
<[email protected]>, Keith Moore <[email protected]>
Subject: Test of new header generator
MIME-Version: 1.0
Content-type: text/plain; charset=ISO-8859-1
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= b)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?=
=?ISO-8859-1?Q?b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a_b?=)
From nobody Mon Sep 17 00:00:00 2001
Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)
......@@ -2,7 +2,10 @@
From nobody Mon Sep 17 00:00:00 2001
From: A U Thor <[email protected]>
From: A
U
Thor
<[email protected]>
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: [PATCH] a commit.
......@@ -501,3 +504,60 @@ index 3e5fe51..aabfe5c 100644
--=-=-=--
From [email protected] Wed Nov 12 17:54:41 2008
From: Dmitriy Blinov <[email protected]>
To: [email protected]
Date: Wed, 12 Nov 2008 17:54:41 +0300
Message-Id: <[email protected]>
X-Mailer: git-send-email 1.5.6.5
MIME-Version: 1.0
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: 8bit
Subject: [Navy-patches] [PATCH]
=?utf-8?b?0JjQt9C80LXQvdGR0L0g0YHQv9C40YHQvtC6INC/0LA=?=
=?utf-8?b?0LrQtdGC0L7QsiDQvdC10L7QsdGF0L7QtNC40LzRi9GFINC00LvRjyA=?=
=?utf-8?b?0YHQsdC+0YDQutC4?=
textlive-* исправлены на texlive-*
docutils заменён на python-docutils
Действительно, оказалось, что rest2web вытягивает за собой
python-docutils. В то время как сам rest2web не нужен.
Signed-off-by: Dmitriy Blinov <[email protected]>
---
howto/build_navy.txt | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/howto/build_navy.txt b/howto/build_navy.txt
index 3fd3afb..0ee807e 100644
--- a/howto/build_navy.txt
+++ b/howto/build_navy.txt
@@ -119,8 +119,8 @@
- libxv-dev
- libusplash-dev
- latex-make
- - textlive-lang-cyrillic
- - textlive-latex-extra
+ - texlive-lang-cyrillic
+ - texlive-latex-extra
- dia
- python-pyrex
- libtool
@@ -128,7 +128,7 @@
- sox
- cython
- imagemagick
- - docutils
+ - python-docutils
#. на машине dinar: добавить свой открытый ssh-ключ в authorized_keys2 пользователя ddev
#. на своей машине: отредактировать /etc/sudoers (команда ``visudo``) примерно следующим образом::
--
1.5.6.5
From nobody Mon Sep 17 00:00:00 2001
From: <[email protected]> (A U Thor)
Date: Fri, 9 Jun 2006 00:44:16 -0700
Subject: [PATCH] a patch
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment