X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4336c6255d8b087c7a2c69db6a84d12a5c58a95b..4e8e2c96547bfe72589982a85fac450df4cf6d08:/uip/dropsbr.c diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 3474e7be..baf8268b 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -350,7 +350,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, * Change the "Return-Path:" field (if in first line) * back to "From ". */ - if (!strncmp (buffer, "Return-Path:", 12)) { + if (has_prefix(buffer, "Return-Path:")) { char tmpbuffer[BUFSIZ]; char *tp, *ep, *fp; @@ -361,7 +361,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, tp = dctime(dlocaltimenow()); snprintf (buffer, sizeof(buffer), "From %.*s %s", (int)(fp - ep), ep, tp); - } else if (!strncmp (buffer, "X-Envelope-From:", 16)) { + } else if (has_prefix(buffer, "X-Envelope-From:")) { /* * Change the "X-Envelope-From:" field * (if first line) back to "From ". @@ -372,7 +372,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, strncpy(tmpbuffer, buffer, sizeof(tmpbuffer)); ep = tmpbuffer + 17; snprintf (buffer, sizeof(buffer), "From %s", ep); - } else if (strncmp (buffer, "From ", 5)) { + } else if (!has_prefix(buffer, "From ")) { /* * If there is already a "From " line, * then leave it alone. Else we add one. @@ -391,7 +391,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, * If this is not first line, and begins with * "From ", then prepend line with ">". */ - if (j != 0 && strncmp (buffer, "From ", 5) == 0) { + if (j != 0 && has_prefix(buffer, "From ")) { if (write (md, ">", 1) < 0) { advise (mailbox, "write"); }