summaryrefslogtreecommitdiffstats
path: root/mh.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 /mh.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 'mh.c')
-rw-r--r--mh.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/mh.c b/mh.c
index 8d44f0fb..bf403114 100644
--- a/mh.c
+++ b/mh.c
@@ -2,17 +2,17 @@
* Copyright (C) 1996-2002,2007,2009 Michael R. Elkins <me@mutt.org>
* Copyright (C) 1999-2005 Thomas Roessler <roessler@does-not-exist.org>
* Copyright (C) 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.
@@ -693,7 +693,7 @@ static void maildir_parse_flags (HEADER * h, const char *path)
if ((p = strrchr (path, ':')) != NULL && mutt_strncmp (p + 1, "2,", 2) == 0)
{
p += 3;
-
+
mutt_str_replace (&h->maildir_flags, p);
q = h->maildir_flags;
@@ -723,7 +723,7 @@ static void maildir_parse_flags (HEADER * h, const char *path)
h->deleted = 1;
}
break;
-
+
default:
*q++ = *p;
break;
@@ -731,7 +731,7 @@ static void maildir_parse_flags (HEADER * h, const char *path)
p++;
}
}
-
+
if (q == h->maildir_flags)
FREE (&h->maildir_flags);
else if (q)
@@ -768,7 +768,7 @@ static void maildir_update_mtime (CONTEXT * ctx)
mutt_buffer_pool_release (&buf);
}
-/*
+/*
* Actually parse a maildir message. This may also be used to fill
* out a fake header structure generated by lazy maildir parsing.
*/
@@ -798,9 +798,9 @@ static HEADER *maildir_parse_message (int magic, const char *fname,
if (magic == MUTT_MAILDIR)
{
- /*
+ /*
* maildir stores its flags in the filename, so ignore the
- * flags in the header of the message
+ * flags in the header of the message
*/
h->old = is_old;
@@ -981,37 +981,37 @@ static struct maildir* maildir_merge_lists (struct maildir *left,
struct maildir* head;
struct maildir* tail;
- if (left && right)
+ if (left && right)
{
if (cmp (left, right) < 0)
{
head = left;
left = left->next;
}
- else
+ else
{
head = right;
right = right->next;
}
- }
- else
+ }
+ else
{
- if (left)
+ if (left)
return left;
- else
+ else
return right;
}
-
+
tail = head;
- while (left && right)
+ while (left && right)
{
if (cmp (left, right) < 0)
{
tail->next = left;
left = left->next;
- }
- else
+ }
+ else
{
tail->next = right;
right = right->next;
@@ -1019,7 +1019,7 @@ static struct maildir* maildir_merge_lists (struct maildir *left,
tail = tail->next;
}
- if (left)
+ if (left)
{
tail->next = left;
}
@@ -1071,7 +1071,7 @@ static struct maildir* maildir_sort (struct maildir* list, size_t len,
struct maildir* right = list;
size_t c = 0;
- if (!list || !list->next)
+ if (!list || !list->next)
{
return list;
}
@@ -1080,7 +1080,7 @@ static struct maildir* maildir_sort (struct maildir* list, size_t len,
return maildir_ins_sort (list, cmp);
list = list->next;
- while (list && list->next)
+ while (list && list->next)
{
right = right->next;
list = list->next->next;
@@ -1129,12 +1129,12 @@ static struct maildir *skip_duplicates (struct maildir *p, struct maildir **last
}
#endif
-/*
+/*
* This function does the second parsing pass
*/
static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
progress_t *progress)
-{
+{
struct maildir *p, *last = NULL;
BUFFER *fn = NULL;
int count;
@@ -1446,7 +1446,7 @@ static void maildir_flags (char *dest, size_t destlen, HEADER * hdr)
* will end up in the cur directory, so we include it in the following
* test even though there is no associated flag.
*/
-
+
if (hdr && (hdr->flagged || hdr->replied || hdr->read || hdr->deleted || hdr->old || hdr->maildir_flags))
{
char tmp[LONG_STRING];
@@ -1506,7 +1506,7 @@ static int mh_close_message (CONTEXT *ctx, MESSAGE *msg)
/*
* Open a new (temporary) message in a maildir folder.
- *
+ *
* Note that this uses _almost_ the maildir file name format, but
* with a {cur,new} prefix.
*
@@ -1587,23 +1587,23 @@ out:
/*
* Commit a message to a maildir folder.
- *
+ *
* msg->path contains the file name of a file in tmp/. We take the
- * flags from this file's name.
+ * flags from this file's name.
*
* ctx is the mail folder we commit to.
- *
+ *
* hdr is a header structure to which we write the message's new
* file name. This is used in the mh and maildir folder synch
* routines. When this routine is invoked from mx_commit_message,
- * hdr is NULL.
+ * hdr is NULL.
*
* msg->path looks like this:
- *
+ *
* tmp/{cur,new}.mutt-HOSTNAME-PID-COUNTER:flags
- *
+ *
* See also maildir_open_new_message().
- *
+ *
*/
static int _maildir_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr)
@@ -1690,9 +1690,9 @@ static int maildir_commit_message (CONTEXT * ctx, MESSAGE * msg)
return _maildir_commit_message (ctx, msg, NULL);
}
-/*
+/*
* commit a message to an MH folder.
- *
+ *
*/
@@ -1741,9 +1741,9 @@ static int _mh_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr,
}
closedir (dirp);
- /*
+ /*
* Now try to rename the file to the proper name.
- *
+ *
* Note: We may have to try multiple times, until we find a free
* slot.
*/
@@ -1786,7 +1786,7 @@ static int mh_commit_message (CONTEXT * ctx, MESSAGE * msg)
/* Sync a message in an MH folder.
- *
+ *
* This code is also used for attachment deletion in maildir
* folders.
*/
@@ -1831,7 +1831,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
restore = 0;
}
- /*
+ /*
* Try to move the new message to the old place.
* (MH only.)
*
@@ -1840,7 +1840,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno)
* Note that there is a race condition against programs which
* use the first free slot instead of the maximum message
* number. Mutt does _not_ behave like this.
- *
+ *
* Anyway, if this fails, the message is in the folder, so
* all what happens is that a concurrently running mutt will
* lose flag modifications.
@@ -1987,9 +1987,9 @@ int mh_sync_mailbox (CONTEXT * ctx, int *index_hint)
if (ctx->magic == MUTT_MH)
i = mh_check_mailbox (ctx, index_hint);
- else
+ else
i = maildir_check_mailbox (ctx, index_hint);
-
+
if (i != 0)
return i;
@@ -2129,7 +2129,7 @@ static void maildir_update_tables (CONTEXT *ctx, int *index_hint)
short old_sort;
int old_count;
int i, j;
-
+
if (Sort != SORT_ORDER)
{
old_sort = Sort;
@@ -2137,13 +2137,13 @@ static void maildir_update_tables (CONTEXT *ctx, int *index_hint)
mutt_sort_headers (ctx, 1);
Sort = old_sort;
}
-
+
old_count = ctx->msgcount;
for (i = 0, j = 0; i < old_count; i++)
{
if (ctx->hdrs[i]->active && index_hint && *index_hint == i)
*index_hint = j;
-
+
if (ctx->hdrs[i]->active)
ctx->hdrs[i]->index = j++;
}
@@ -2159,7 +2159,7 @@ static int maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n)
*/
int context_changed = ctx->changed;
int header_changed;
-
+
/* user didn't modify this message. alter the flags to match the
* current state on disk. This may not actually do
* anything. mutt_set_flag() will just ignore the call if the status
@@ -2181,7 +2181,7 @@ static int maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n)
*/
header_changed = o->changed;
o->changed = 0;
-
+
/* if the mailbox was not modified before we made these
* changes, unset the changed flag since nothing needs to
* be synchronized.
@@ -2355,7 +2355,7 @@ static int maildir_check_mailbox (CONTEXT * ctx, int *index_hint)
/* If we didn't just get new mail, update the tables. */
if (occult)
maildir_update_tables (ctx, index_hint);
-
+
/* do any delayed parsing we need to do. */
maildir_delayed_parsing (ctx, &md, NULL);
@@ -2373,7 +2373,7 @@ static int maildir_check_mailbox (CONTEXT * ctx, int *index_hint)
return 0;
}
-/*
+/*
* This function handles arrival of new mail and reopening of
* mh/maildir folders. Things are getting rather complex because we
* don't have a well-defined "mailbox order", so the tricks from
@@ -2407,14 +2407,14 @@ static int mh_check_mailbox (CONTEXT * ctx, int *index_hint)
mutt_buffer_pool_release (&buf);
return -1;
}
-
+
/* create .mh_sequences when there isn't one. */
mutt_buffer_printf (buf, "%s/.mh_sequences", ctx->path);
if ((i = stat (mutt_b2s (buf), &st_cur)) == -1 && errno == ENOENT)
{
char *tmp;
FILE *fp = NULL;
-
+
if (mh_mkstemp (ctx, &fp, &tmp) == 0)
{
safe_fclose (&fp);
@@ -2703,7 +2703,7 @@ int mh_check_empty (const char *path)
DIR *dp;
struct dirent *de;
int r = 1; /* assume empty until we find a message */
-
+
if ((dp = opendir (path)) == NULL)
return -1;
while ((de = readdir (dp)))
@@ -2715,7 +2715,7 @@ int mh_check_empty (const char *path)
}
}
closedir (dp);
-
+
return r;
}