Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rs/mailinfo-header-cmp'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 9 Jun 2014 18:27:53 +0000
(11:27 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 9 Jun 2014 18:27:53 +0000
(11:27 -0700)
Avoid running over the end of header string while parsing an
incoming e-mail message to extract the patch.
* rs/mailinfo-header-cmp:
mailinfo: use strcmp() for string comparison
1
2
builtin/mailinfo.c
patch
|
diff1
|
diff2
|
blob
|
history
raw
|
combined
(merge:
53b4d83
b1a013d
)
diff --cc
builtin/mailinfo.c
index 2c3cd8eab7073669001ad605020577279ba7a07d,6b44156264d246e363dd187666f142c7658c40b0..cf11c8d6071dd791508d3bd5f46d30550765a90f
---
1
/
builtin/mailinfo.c
---
2
/
builtin/mailinfo.c
+++ b/
builtin/mailinfo.c
@@@
-332,9
-332,9
+332,9
@@@
static int check_header(const struct st
ret = 1; /* Should this return 0? */
goto check_header_out;
}
- if (
!prefixcmp
(line->buf, "[PATCH]") && isspace(line->buf[7])) {
+ if (
starts_with
(line->buf, "[PATCH]") && isspace(line->buf[7])) {
for (i = 0; header[i]; i++) {
- if (!
memcmp("Subject", header[i], 7
)) {
+ if (!
strcmp("Subject", header[i]
)) {
handle_header(&hdr_data[i], line);
ret = 1;
goto check_header_out;