Skip to content

Commit 76adaf5

Browse files
committed
post-applypatch: allow folded Message-ID line
1 parent 0fcdc76 commit 76adaf5

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

post-applypatch

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,32 @@ prec=4 &&
77
this=$(cat 2>/dev/null "$dotest/next") &&
88
msgnum=$(printf "%0${prec}d" $this) &&
99
test -f "$dotest/$msgnum" &&
10-
message_id=$(sed -n '
11-
/^Message-I[Dd]:[ ]*\(<.*>\)[ ]*$/{
12-
s//\1/p
10+
message_id=$(sed -ne '
11+
/^[ ]/{
12+
# Append continuation line
13+
H
14+
x
15+
s/\n//
16+
x
17+
n
18+
}
19+
# Hold this new line, and look at what is in the hold space
20+
x
21+
# Is it the Message-ID line? If so, spit out and finish.
22+
/^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:[ ]*/{
23+
s///p
1324
q
1425
}
15-
/^$/q
26+
# Otherwise, check if this new line is empty
27+
x
28+
# Is it? Then we are done with the header
29+
/^$/b end
30+
# Otherwise we need to hold onto this header line
31+
x
32+
# And start the next cycle
33+
b
34+
: end
35+
q
1636
' "$dotest/$msgnum") &&
1737

1838
test -n "$message_id" &&

0 commit comments

Comments
 (0)