From f88a545a94cb474d370ef97dd3694d09b6ac90c1 Mon Sep 17 00:00:00 2001 From: Simon Sasburg Date: Thu, 1 Nov 2007 23:57:45 +0100 Subject: Make mailsplit and mailinfo strip whitespace from the start of the input Signed-off-by: Simon Sasburg Signed-off-by: Junio C Hamano --- builtin-mailinfo.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'builtin-mailinfo.c') diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index fb12248f82..2600847974 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -915,6 +915,7 @@ static void handle_info(void) static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding, const char *msg, const char *patch) { + int peek; keep_subject = ks; metainfo_charset = encoding; fin = in; @@ -935,6 +936,11 @@ static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding, p_hdr_data = xcalloc(MAX_HDR_PARSED, sizeof(char *)); s_hdr_data = xcalloc(MAX_HDR_PARSED, sizeof(char *)); + do { + peek = fgetc(in); + } while (isspace(peek)); + ungetc(peek, in); + /* process the email header */ while (read_one_header_line(line, sizeof(line), fin)) check_header(line, sizeof(line), p_hdr_data, 1); -- cgit v1.2.3