projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reformated comments and long lines
[mmh]
/
uip
/
dropsbr.c
diff --git
a/uip/dropsbr.c
b/uip/dropsbr.c
index
0e3ce19
..
40de763
100644
(file)
--- 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 <h/nmh.h>
#include <h/utils.h>
#include <h/nmh.h>
#include <h/utils.h>
@@
-28,17
+28,17
@@
#include <fcntl.h>
/*
#include <fcntl.h>
/*
- * static prototypes
- */
+** static prototypes
+*/
static int mbx_chk_mbox (int);
static int mbx_chk_mmdf (int);
static int map_open (char *, int);
/*
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)
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;
/*
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;
/*
if (fd == NOTOK || mbx_style == OTHER_FORMAT)
return fd;
/*
- * Do sanity checks on maildrop.
- */
+ ** Do sanity checks on maildrop.
+ */
if (fstat (fd, &st) == NOTOK) {
/*
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) {
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)
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)
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,
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++) {
/*
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) {
/*
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;
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)) {
/*
(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;
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)) {
/*
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;
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++;
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)
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;
}
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)
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)
char *
map_name (char *file)