diff --git a/blaze822.c b/blaze822.c index 84d56b4..5a98915 100644 --- a/blaze822.c +++ b/blaze822.c @@ -349,7 +349,7 @@ blaze822(char *file) mesg->msg = buf; mesg->end = end; - mesg->body = mesg->bodyend = mesg->bodychunk = 0; + mesg->body = mesg->bodyend = mesg->bodychunk = mesg->orig_header = 0; return mesg; } @@ -391,6 +391,7 @@ blaze822_mem(char *src, size_t len) mesg->msg = buf; mesg->end = end; mesg->bodychunk = 0; // src is not ours + mesg->orig_header = src; return mesg; } @@ -558,6 +559,7 @@ blaze822_mmap(char *file) mesg->msg = mesg->bodychunk = buf; mesg->end = end; mesg->bodyend = buf + len; + mesg->orig_header = 0; return mesg; @@ -578,6 +580,12 @@ blaze822_body(struct message *mesg) return mesg->body; } +char * +blaze822_orig_header(struct message *mesg) +{ + return mesg->orig_header; +} + size_t blaze822_bodylen(struct message *mesg) { diff --git a/blaze822.h b/blaze822.h index 0f8329b..2ffc031 100644 --- a/blaze822.h +++ b/blaze822.h @@ -24,6 +24,8 @@ char *blaze822_body(struct message *mesg); size_t blaze822_bodylen(struct message *mesg); size_t blaze822_headerlen(struct message *mesg); +char *blaze822_orig_header(struct message *mesg); + // rfc2047.c int blaze822_decode_rfc2047(char *, char *, size_t, char *); diff --git a/blaze822_priv.h b/blaze822_priv.h index bf895d3..c871ca7 100644 --- a/blaze822_priv.h +++ b/blaze822_priv.h @@ -4,6 +4,7 @@ struct message { char *body; char *bodyend; char *bodychunk; + char *orig_header; }; // WSP = SP / HTAB