summaryrefslogtreecommitdiff
path: root/mail.local
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-03 12:50:32 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-03 12:50:32 +0000
commit79b0dc3d9e025d6863ef1d5bbfdcbe7d7026c779 (patch)
treec488971e68c6f8522f878c49a30aa4cd1f8c197b /mail.local
parentba8d24dc1948887701a669a256dd11a2dc3506d7 (diff)
downloadmailutils-79b0dc3d9e025d6863ef1d5bbfdcbe7d7026c779.tar.gz
mailutils-79b0dc3d9e025d6863ef1d5bbfdcbe7d7026c779.tar.bz2
Fixed indentation.
Diffstat (limited to 'mail.local')
-rw-r--r--mail.local/main.c97
1 files changed, 50 insertions, 47 deletions
diff --git a/mail.local/main.c b/mail.local/main.c
index 9ec146181..d661cd206 100644
--- a/mail.local/main.c
+++ b/mail.local/main.c
@@ -292,46 +292,47 @@ make_tmp (const char *from, char **tempfile)
}
line = 0;
- while (getline (&buf, &n, stdin) > 0) {
- line++;
- if (line == 1)
- {
- if (memcmp (buf, "From ", 5))
- {
- struct mu_auth_data *auth;
- if (!from)
- {
- auth = mu_get_auth_by_uid (uid);
- if (auth)
- from = auth->name;
- }
- if (from)
- {
- time (&t);
- fprintf (fp, "From %s %s", from, ctime (&t));
- }
- else
- {
- mailer_err ("Can't determine sender address");
- exit (EX_UNAVAILABLE);
- }
- if (auth)
- mu_auth_data_free (auth);
- }
- }
- else if (!memcmp (buf, "From ", 5))
- fputc ('>', fp);
- if (fputs (buf, fp) == EOF)
- {
- mailer_err ("temporary file write error");
- fclose (fp);
- return NULL;
- }
- }
-
+ while (getline (&buf, &n, stdin) > 0)
+ {
+ line++;
+ if (line == 1)
+ {
+ if (memcmp (buf, "From ", 5))
+ {
+ struct mu_auth_data *auth;
+ if (!from)
+ {
+ auth = mu_get_auth_by_uid (uid);
+ if (auth)
+ from = auth->name;
+ }
+ if (from)
+ {
+ time (&t);
+ fprintf (fp, "From %s %s", from, ctime (&t));
+ }
+ else
+ {
+ mailer_err ("Can't determine sender address");
+ exit (EX_UNAVAILABLE);
+ }
+ if (auth)
+ mu_auth_data_free (auth);
+ }
+ }
+ else if (!memcmp (buf, "From ", 5))
+ fputc ('>', fp);
+ if (fputs (buf, fp) == EOF)
+ {
+ mailer_err ("temporary file write error");
+ fclose (fp);
+ return NULL;
+ }
+ }
+
if (buf && strchr (buf, '\n') == NULL)
putc ('\n', fp);
-
+
putc ('\n', fp);
free (buf);
@@ -465,15 +466,17 @@ deliver (FILE *fp, char *name)
n = 0;
status = 0;
fseek (fp, 0, SEEK_SET);
- while (getline(&buf, &n, fp) > 0) {
- status = stream_write (stream, buf, strlen (buf), off, &nwr);
- if (status)
- {
- mailer_err ("error writing to mailbox: %s", mu_errstring (status));
- break;
- }
- off += nwr;
- }
+ while (getline(&buf, &n, fp) > 0)
+ {
+ status = stream_write (stream, buf, strlen (buf), off, &nwr);
+ if (status)
+ {
+ mailer_err ("error writing to mailbox: %s",
+ mu_errstring (status));
+ break;
+ }
+ off += nwr;
+ }
free (buf);
switch_user_id (0);
}

Return to:

Send suggestions and report system problems to the System administrator.