Skip to content

Commit

Permalink
git-am: fixed patch_format detection according to RFC2822
Browse files Browse the repository at this point in the history
RFC2822 specifies in paragraph 3.6.8, that optional header fields are
made up of any printable US-ASCII character except ' ' (space) and ':'
(colon).

The pattern for the egrep command is changed to match all of these
characters.

Signed-off-by: Christian Himpel <chressie@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Christian Himpel authored and Shawn O. Pearce committed Sep 25, 2009
1 parent fb3650e commit 6900d75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ check_patch_format () {
# and see if it looks like that they all begin with the
# header field names...
sed -n -e '/^$/q' -e '/^[ ]/d' -e p "$1" |
egrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||
egrep -v '^[!-9;-~]+:' >/dev/null ||
patch_format=mbox
fi
} < "$1" || clean_abort
Expand Down

0 comments on commit 6900d75

Please sign in to comment.