summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 405053d)
raw | patch | inline | side by side (parent: 405053d)
author | Eric W. Biederman <ebiederm@xmission.com> | |
Tue, 23 May 2006 19:44:11 +0000 (13:44 -0600) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 23 May 2006 21:00:15 +0000 (14:00 -0700) |
Currently we only use the return value from read_one_header line
to tell if the line we have read is a header or not. So make
it a flag. This paves the way for better email detection.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
to tell if the line we have read is a header or not. So make
it a flag. This paves the way for better email detection.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
mailinfo.c | patch | blob | history |
diff --git a/mailinfo.c b/mailinfo.c
index b27651935db85cf0ab651d523c502943d137b7cd..83a2986e7edc7e7db8878eaafe5a285e3a66e78c 100644 (file)
--- a/mailinfo.c
+++ b/mailinfo.c
int namelen;
};
-static void check_header(char *line, int len, struct header_def *header)
+static void check_header(char *line, struct header_def *header)
{
int i;
}
}
-static void check_subheader_line(char *line, int len)
+static void check_subheader_line(char *line)
{
static struct header_def header[] = {
{ "Content-Type", handle_subcontent_type },
handle_content_transfer_encoding },
{ NULL },
};
- check_header(line, len, header);
+ check_header(line, header);
}
-static void check_header_line(char *line, int len)
+static void check_header_line(char *line)
{
static struct header_def header[] = {
{ "From", handle_from },
handle_content_transfer_encoding },
{ NULL },
};
- check_header(line, len, header);
+ check_header(line, header);
}
static int read_one_header_line(char *line, int sz, FILE *in)
return;
/* We are on boundary line. Start slurping the subhead. */
while (1) {
- int len = read_one_header_line(line, sizeof(line), stdin);
- if (!len) {
+ int hdr = read_one_header_line(line, sizeof(line), stdin);
+ if (!hdr) {
if (handle_multipart_one_part() < 0)
return;
/* Reset per part headers */
charset[0] = 0;
}
else
- check_subheader_line(line, len);
+ check_subheader_line(line);
}
fclose(patchfile);
if (!patch_lines) {
exit(1);
}
while (1) {
- int len = read_one_header_line(line, sizeof(line), stdin);
- if (!len) {
+ int hdr = read_one_header_line(line, sizeof(line), stdin);
+ if (!hdr) {
if (multipart_boundary[0])
handle_multipart_body();
else
handle_body();
break;
}
- check_header_line(line, len);
+ check_header_line(line);
}
return 0;
}