X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fdropsbr.c;h=40de7638eda2685e55f91ab3425a2849a31601fa;hp=0e3ce193060ca7299f22f302113029e394e508dc;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=337338b404931f06f0db2119c9e145e8ca5a9860 diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 0e3ce19..40de763 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -1,10 +1,10 @@ /* - * dropsbr.c -- create/read/manipulate mail drops - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** dropsbr.c -- create/read/manipulate mail drops +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include #include @@ -28,17 +28,17 @@ #include /* - * static prototypes - */ +** static prototypes +*/ static int mbx_chk_mbox (int); static int mbx_chk_mmdf (int); static int map_open (char *, int); /* - * Main entry point to open/create and lock - * a file or maildrop. - */ +** Main entry point to open/create and lock +** a file or maildrop. +*/ int mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) @@ -78,20 +78,20 @@ mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) errno = j; /* - * Return if we still failed after 4 attempts, - * or we just want to skip the sanity checks. - */ + ** Return if we still failed after 4 attempts, + ** or we just want to skip the sanity checks. + */ if (fd == NOTOK || mbx_style == OTHER_FORMAT) return fd; /* - * Do sanity checks on maildrop. - */ + ** Do sanity checks on maildrop. + */ if (fstat (fd, &st) == NOTOK) { /* - * The stat failed. So we make sure file - * has right ownership/modes - */ + ** The stat failed. So we make sure file + ** has right ownership/modes + */ chown (file, uid, gid); chmod (file, mode); } else if (st.st_size > (off_t) 0) { @@ -121,8 +121,8 @@ mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) /* - * Check/prepare MBOX style maildrop for appending. - */ +** Check/prepare MBOX style maildrop for appending. +*/ static int mbx_chk_mbox (int fd) @@ -136,8 +136,8 @@ mbx_chk_mbox (int fd) /* - * Check/prepare MMDF style maildrop for appending. - */ +** Check/prepare MMDF style maildrop for appending. +*/ static int mbx_chk_mmdf (int fd) @@ -275,8 +275,8 @@ mbx_write(char *mailbox, int md, FILE *fp, int id, long last, /* - * Append message to end of file or maildrop. - */ +** Append message to end of file or maildrop. +*/ int mbx_copy (char *mailbox, int mbx_style, int md, int fd, @@ -356,13 +356,13 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, for (j = 0; fgets (buffer, sizeof(buffer), fp) != NULL; j++) { /* - * Check the first line, and make some changes. - */ + ** Check the first line, and make some changes. + */ if (j == 0 && !text) { /* - * Change the "Return-Path:" field (if in first line) - * back to "From ". - */ + ** Change the "Return-Path:" field + ** (if in first line) back to "From ". + */ if (!strncmp (buffer, "Return-Path:", 12)) { char tmpbuffer[BUFSIZ]; char *tp, *ep, *fp; @@ -376,9 +376,10 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, (int)(fp - ep), ep, tp); } else if (!strncmp (buffer, "X-Envelope-From:", 16)) { /* - * Change the "X-Envelope-From:" field - * (if first line) back to "From ". - */ + ** Change the "X-Envelope-From:" + ** field (if first line) back + ** to "From ". + */ char tmpbuffer[BUFSIZ]; char *ep; @@ -387,9 +388,10 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, snprintf (buffer, sizeof(buffer), "From %s", ep); } else if (strncmp (buffer, "From ", 5)) { /* - * If there is already a "From " line, - * then leave it alone. Else we add one. - */ + ** If there is already a "From " + ** line, then leave it alone. + ** Else we add one. + */ char tmpbuffer[BUFSIZ]; char *tp, *ep; @@ -401,9 +403,9 @@ 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 this is not first line, and begins with + ** "From ", then prepend line with ">". + */ if (j != 0 && strncmp (buffer, "From ", 5) == 0) { write (md, ">", 1); size++; @@ -429,7 +431,8 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, lseek (fd, (off_t) 0, SEEK_END); stop = lseek (md, (off_t) 0, SEEK_CUR); if (mapping) - map_write (mailbox, md, 0, (long) 0, start, stop, pos, size, noisy); + map_write (mailbox, md, 0, (long) 0, start, + stop, pos, size, noisy); return OK; } @@ -460,8 +463,8 @@ mbx_size (int md, off_t start, off_t stop) /* - * Close and unlock file/maildrop. - */ +** Close and unlock file/maildrop. +*/ int mbx_close (char *mailbox, int md) @@ -473,9 +476,9 @@ mbx_close (char *mailbox, int md) /* - * This function is performed implicitly by getbbent.c: - * bb->bb_map = map_name (bb->bb_file); - */ +** This function is performed implicitly by getbbent.c: +** bb->bb_map = map_name (bb->bb_file); +*/ char * map_name (char *file)