summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-12-31 16:06:53 -0800
committerKevin McCarthy <kevin@8t8.us>2018-12-31 16:06:53 -0800
commit443295ee65c3ebc5085fcab3cc9d533b0fac4f0f (patch)
treedc425cf8028e3b78c635148bfc0a905b1e800327 /mbox.c
parent1c59c27129b45b9f2cfd630428f57c643276b906 (diff)
Remove trailing whitespace.
The result of find . -name "*.[ch]" -exec emacs -batch {} \ --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/mbox.c b/mbox.c
index 254db452..6793d8e2 100644
--- a/mbox.c
+++ b/mbox.c
@@ -1,20 +1,20 @@
/*
* Copyright (C) 1996-2002,2010,2013 Michael R. Elkins <me@mutt.org>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+ */
/* This file contains code to parse ``mbox'' and ``mmdf'' style mailboxes */
@@ -64,7 +64,7 @@ int mbox_lock_mailbox (CONTEXT *ctx, int excl, int retry)
ctx->readonly = 1;
return 0;
}
-
+
return (r);
}
@@ -169,7 +169,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
mutt_error _("Mailbox is corrupt!");
return (-1);
}
- }
+ }
else
hdr->received = t - mutt_local_tz (t);
@@ -322,12 +322,12 @@ int mbox_parse_mailbox (CONTEXT *ctx)
if (ctx->msgcount == ctx->hdrmax)
mx_alloc_memory (ctx);
-
+
curhdr = ctx->hdrs[ctx->msgcount] = mutt_new_header ();
curhdr->received = t - mutt_local_tz (t);
curhdr->offset = loc;
curhdr->index = ctx->msgcount;
-
+
curhdr->env = mutt_read_rfc822_header (ctx->fp, curhdr, 0, 0);
/* if we know how long this message is, either just skip over the body,
@@ -409,10 +409,10 @@ int mbox_parse_mailbox (CONTEXT *ctx)
}
else
lines++;
-
+
loc = ftello (ctx->fp);
}
-
+
/*
* Only set the content-length of the previous message if we have read more
* than one message during _this_ invocation. If this routine is called
@@ -718,7 +718,7 @@ static int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
}
/*
- * Check to make sure that the only change to the mailbox is that
+ * Check to make sure that the only change to the mailbox is that
* message(s) were appended to this file. My heuristic is that we should
* see the message separator at *exactly* what used to be the end of the
* folder.
@@ -905,11 +905,11 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
/* find the first deleted/changed message. we save a lot of time by only
* rewriting the mailbox from the point where it has actually changed.
*/
- for (i = 0 ; i < ctx->msgcount && !ctx->hdrs[i]->deleted &&
+ for (i = 0 ; i < ctx->msgcount && !ctx->hdrs[i]->deleted &&
!ctx->hdrs[i]->changed && !ctx->hdrs[i]->attach_del; i++)
;
if (i == ctx->msgcount)
- {
+ {
/* this means ctx->changed or ctx->deleted was set, but no
* messages were found to be changed or deleted. This should
* never happen, is we presume it is a bug in mutt.
@@ -922,16 +922,16 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
}
/* save the index of the first changed/deleted message */
- first = i;
+ first = i;
/* where to start overwriting */
- offset = ctx->hdrs[i]->offset;
+ offset = ctx->hdrs[i]->offset;
/* the offset stored in the header does not include the MMDF_SEP, so make
* sure we seek to the correct location
*/
if (ctx->magic == MUTT_MMDF)
offset -= (sizeof MMDF_SEP - 1);
-
+
/* allocate space for the new offsets */
newOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
oldOffset = safe_calloc (ctx->msgcount - first, sizeof (struct m_update_t));
@@ -950,7 +950,7 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
* back up some information which is needed to restore offsets when
* something fails.
*/
-
+
oldOffset[i-first].valid = 1;
oldOffset[i-first].hdr = ctx->hdrs[i]->offset;
oldOffset[i-first].body = ctx->hdrs[i]->content->offset;
@@ -970,7 +970,7 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
unlink (tempfile);
goto bail;
}
-
+
}
/* save the new offset for this message. we add `offset' because the
@@ -999,17 +999,17 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
switch(ctx->magic)
{
- case MUTT_MMDF:
- if(fputs(MMDF_SEP, fp) == EOF)
+ case MUTT_MMDF:
+ if(fputs(MMDF_SEP, fp) == EOF)
{
mutt_perror (tempfile);
mutt_sleep (5);
unlink (tempfile);
- goto bail;
+ goto bail;
}
break;
default:
- if(fputs("\n", fp) == EOF)
+ if(fputs("\n", fp) == EOF)
{
mutt_perror (tempfile);
mutt_sleep (5);
@@ -1019,7 +1019,7 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
}
}
}
-
+
if (fclose (fp) != 0)
{
fp = NULL;
@@ -1099,9 +1099,9 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
/* error occurred while writing the mailbox back, so keep the temp copy
* around
*/
-
+
char savefile[_POSIX_PATH_MAX];
-
+
snprintf (savefile, sizeof (savefile), "%s/mutt.%s-%s-%u",
NONULL (Tempdir), NONULL(Username), NONULL(Hostname), (unsigned int)getpid ());
rename (tempfile, savefile);
@@ -1167,7 +1167,7 @@ bail: /* Come here in case of disaster */
ctx->hdrs[i]->content->length = oldOffset[i-first].length;
}
}
-
+
/* this is ok to call even if we haven't locked anything */
mbox_unlock_mailbox (ctx);
@@ -1202,10 +1202,10 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
/* silent operations */
ctx->quiet = 1;
-
+
if (!ctx->quiet)
mutt_message _("Reopening mailbox...");
-
+
/* our heuristics require the old mailbox to be unsorted */
if (Sort != SORT_ORDER)
{
@@ -1219,7 +1219,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
old_hdrs = NULL;
old_msgcount = 0;
-
+
/* simulate a close */
if (ctx->id_hash)
hash_destroy (&ctx->id_hash, NULL);
@@ -1273,7 +1273,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
rc = -1;
break;
}
-
+
if (rc == -1)
{
/* free the old headers */