Commit 443295ee authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Remove trailing whitespace.

The result of
  find . -name "*.[ch]" -exec emacs -batch {} \
    --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
parent 1c59c271
Pipeline #41774220 passed with stages
in 2 minutes and 57 seconds
/*
* Copyright (C) 2000-2007 Brendan Cully <brendan@kublai.com>
*
*
* 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.
*/
*/
/* remote host account manipulation (POP/IMAP) */
......@@ -50,7 +50,7 @@ int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
if (a1->type == MUTT_ACCT_TYPE_POP && PopUser)
user = PopUser;
#endif
if (a1->flags & a2->flags & MUTT_ACCT_USER)
return (!strcmp (a1->user, a2->user));
if (a1->flags & MUTT_ACCT_USER)
......@@ -306,7 +306,7 @@ char* mutt_account_getoauthbearer (ACCOUNT* account)
/* Determine the length of the keyed message digest, add 50 for
* overhead.
*/
oalen = strlen (account->login) + strlen (account->host) + strlen (token) + 50;
oalen = strlen (account->login) + strlen (account->host) + strlen (token) + 50;
oauthbearer = safe_malloc (oalen);
snprintf (oauthbearer, oalen,
......
/*
* Copyright (C) 2000-2007,2012 Brendan Cully <brendan@kublai.com>
*
*
* 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.
*/
*/
/* remote host account manipulation (POP/IMAP) */
......
/*
* Copyright (C) 1996-2000,2007 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.
*/
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -87,9 +87,9 @@ static int alias_tag (MUTTMENU *menu, int n, int m)
{
ALIAS *cur = ((ALIAS **) menu->data)[n];
int ot = cur->tagged;
cur->tagged = (m >= 0 ? m : !cur->tagged);
return cur->tagged - ot;
}
......@@ -115,7 +115,7 @@ static int alias_SortAddress (const void *a, const void *b)
else if (pb == NULL)
r = 1;
else if (pa->personal)
{
{
if (pb->personal)
r = mutt_strcasecmp (pa->personal, pb->personal);
else
......@@ -139,7 +139,7 @@ void mutt_alias_menu (char *buf, size_t buflen, ALIAS *aliases)
char helpstr[LONG_STRING];
int omax;
if (!aliases)
{
mutt_error _("You have no aliases!");
......@@ -156,7 +156,7 @@ void mutt_alias_menu (char *buf, size_t buflen, ALIAS *aliases)
new_aliases:
omax = menu->max;
/* count the number of aliases */
for (aliasp = aliases; aliasp; aliasp = aliasp->next)
{
......@@ -190,7 +190,7 @@ new_aliases:
aliases = aliases->next;
goto new_aliases;
}
switch ((op = mutt_menuLoop (menu)))
{
case OP_DELETE:
......@@ -238,5 +238,5 @@ new_aliases:
mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&AliasTable);
}
/*
* Copyright (C) 1996-2002 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.
*/
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -44,7 +44,7 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
LIST *u;
char i;
const char *fqdn;
while (a)
{
if (!a->group && !a->personal && a->mailbox && strchr (a->mailbox, '@') == NULL)
......@@ -52,7 +52,7 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
t = mutt_lookup_alias (a->mailbox);
if (t)
{
{
i = 0;
for (u = *expn; u; u = u->next)
{
......@@ -92,10 +92,10 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
if (pw)
{
char namebuf[STRING];
mutt_gecos_name (namebuf, sizeof (namebuf), pw);
mutt_str_replace (&a->personal, namebuf);
#ifdef EXACT_ADDRESS
FREE (&a->val);
#endif
......@@ -144,7 +144,7 @@ void mutt_expand_aliases_env (ENVELOPE *env)
}
/*
/*
* if someone has an address like
* From: Michael `/bin/rm -f ~` Elkins <me@mutt.org>
* and the user creates an alias for this, Mutt could wind up executing
......@@ -157,10 +157,10 @@ void mutt_expand_aliases_env (ENVELOPE *env)
* since that would get aliased as
* alias me Michael \\`/bin/rm -f ~\\` Elkins <me@mutt.org>
* which still gets evaluated because the double backslash is not a quote.
*
*
* Additionally, we need to quote ' and " characters - otherwise, mutt will
* interpret them on the wrong parsing step.
*
*
* $ wants to be quoted since it may indicate the start of an environment
* variable.
*/
......@@ -254,7 +254,7 @@ void mutt_create_alias (ENVELOPE *cur, ADDRESS *iadr)
/* Don't suggest a bad alias name in the event of a strange local part. */
mutt_check_alias_name (tmp, buf, sizeof (buf));
retry_name:
/* L10N: prompt to add a new alias */
if (mutt_get_field (_("Alias as: "), buf, sizeof (buf), 0) != 0 || !buf[0])
......@@ -266,7 +266,7 @@ retry_name:
mutt_error _("You already have an alias defined with that name!");
return;
}
if (mutt_check_alias_name (buf, fixed, sizeof (fixed)))
{
switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), MUTT_YES))
......@@ -274,24 +274,24 @@ retry_name:
case MUTT_YES:
strfcpy (buf, fixed, sizeof (buf));
goto retry_name;
case -1:
case -1:
return;
}
}
new = safe_calloc (1, sizeof (ALIAS));
new->self = new;
new->name = safe_strdup (buf);
mutt_addrlist_to_local (adr);
if (adr)
strfcpy (buf, adr->mailbox, sizeof (buf));
else
buf[0] = 0;
mutt_addrlist_to_intl (adr, NULL);
do
{
if (mutt_get_field (_("Address: "), buf, sizeof (buf), 0) != 0 || !buf[0])
......@@ -299,7 +299,7 @@ retry_name:
mutt_free_alias (&new);
return;
}
if((new->addr = rfc822_parse_adrlist (new->addr, buf)) == NULL)
BEEP ();
if (mutt_addrlist_to_intl (new->addr, &err))
......@@ -311,7 +311,7 @@ retry_name:
}
}
while(new->addr == NULL);
if (adr && adr->personal && !mutt_is_mail_list (adr))
strfcpy (buf, adr->personal, sizeof (buf));
else
......@@ -334,7 +334,7 @@ retry_name:
}
mutt_alias_add_reverse (new);
if ((t = Aliases))
{
while (t->next)
......@@ -387,14 +387,14 @@ retry_name:
mutt_perror (buf);
return;
fseek_err:
mutt_perror (_("Error seeking in alias file"));
safe_fclose (&rc);
return;
}
/*
/*
* Sanity-check an alias name: Only characters which are non-special to both
* the RFC 822 and the mutt configuration parser are permitted.
*/
......@@ -448,7 +448,7 @@ ADDRESS *alias_reverse_lookup (ADDRESS *a)
{
if (!a || !a->mailbox)
return NULL;
return hash_find (ReverseAlias, a->mailbox);
}
......@@ -579,10 +579,10 @@ int mutt_alias_complete (char *s, size_t buflen)
a_list->next = a_cur->next;
else
Aliases = a_cur->next;
a_cur->next = NULL;
mutt_free_alias (&a_cur);
if (a_list)
a_cur = a_list;
else
......@@ -594,18 +594,18 @@ int mutt_alias_complete (char *s, size_t buflen)
a_cur = a_cur->next;
}
}
return 0;
}
static int string_is_address(const char *str, const char *u, const char *d)
{
char buf[LONG_STRING];
snprintf(buf, sizeof(buf), "%s@%s", NONULL(u), NONULL(d));
if (ascii_strcasecmp(str, buf) == 0)
return 1;
return 0;
}
......@@ -663,7 +663,7 @@ int mutt_addr_is_user (ADDRESS *addr)
else
return 1;
}
dprint (5, (debugfile, "mutt_addr_is_user: no, all failed.\n"));
return 0;
}
/*
* Copyright (C) 2001 Thomas Roessler <roessler@does-not-exist.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.
*
*
*/
/*
/*
* Versions of the string comparison functions which are
* locale-insensitive.
*/
......@@ -48,7 +48,7 @@ inline int ascii_toupper (int c)
{
if (ascii_islower (c))
return c & ~32;
return c;
}
......@@ -56,21 +56,21 @@ inline int ascii_tolower (int c)
{
if (ascii_isupper (c))
return c | 32;
return c;
}
int ascii_strcasecmp (const char *a, const char *b)
{
int i;
if (a == b)
return 0;
if (a == NULL && b)
return -1;
if (b == NULL && a)
return 1;
for (;; a++, b++)
{
if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
......@@ -81,26 +81,26 @@ int ascii_strcasecmp (const char *a, const char *b)
if (!*a)
break;
}
return 0;
}
int ascii_strncasecmp (const char *a, const char *b, int n)
{
int i, j;
if (a == b)
return 0;
if (a == NULL && b)
return -1;
if (b == NULL && a)
return 1;
for (j = 0; (*a || *b) && j < n; a++, b++, j++)
{
if ((i = ascii_tolower (*a) - ascii_tolower (*b)))
return i;
}
return 0;
}
/*
* Copyright (C) 2001-2002 Thomas Roessler <roessler@does-not-exist.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.
*
*
*/
/*
/*
* Versions of the string comparison functions which are
* locale-insensitive.
*/
......
This diff is collapsed.
/*
* Copyright (C) 1996-2000 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.
*/
*/
/* common protos for compose / attach menus */
......
......@@ -4,39 +4,39 @@
* 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,
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/
/*
/*
* Base64 handling elsewhere in mutt should be modified to call
* these routines. These routines were written because IMAP's
* AUTHENTICATE protocol required them, and base64 handling
* elsewhere wasn't sufficiently generic.
*
*
*/
/*
/*
* This code is heavily modified from fetchmail (also GPL'd, of
* course) by Brendan Cully <brendan@kublai.com>.
*
*
* Original copyright notice:
*
*
* The code in the fetchmail distribution is Copyright 1997 by Eric
* S. Raymond. Portions are also copyrighted by Carl Harris, 1993
* and 1995. Copyright retained for the purpose of protecting free
* redistribution of source.
*
* redistribution of source.
*
*/
#if HAVE_CONFIG_H
......
/*
* Copyright (C) 1996-2000,2007,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.
*/
*/
#if HAVE_CONFIG_H
# include "config.h"
......@@ -157,9 +157,9 @@ static int link_is_dir (const char *folder, const char *path)
{
struct stat st;
char fullpath[_POSIX_PATH_MAX];
mutt_concat_path (fullpath, folder, path, sizeof (fullpath));
if (stat (fullpath, &st) == 0)
return (S_ISDIR (st.st_mode));
else
......@@ -185,7 +185,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
snprintf (dest, destlen, tmp, folder->num + 1);
break;
case 'd':
case 'D':
if (folder->ff->local)
......@@ -214,7 +214,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
else
mutt_format_s (dest, destlen, fmt, "");
break;
case 'f':
{
char *s;
......@@ -229,7 +229,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
folder->ff->local ? (S_ISLNK (folder->ff->mode) ? "@" :
(S_ISDIR (folder->ff->mode) ? "/" :
((folder->ff->mode & S_IXUSR) != 0 ? "*" : ""))) : "");
mutt_format_s (dest, destlen, fmt, fn);
break;
}
......@@ -256,12 +256,12 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
snprintf (permission, sizeof (permission), "IMAP %c",
(folder->ff->inferiors && folder->ff->selectable) ? '+' : ' ');
mutt_format_s (dest, destlen, fmt, permission);
}
}
#endif
else
mutt_format_s (dest, destlen, fmt, "");
break;
case 'g':
if (folder->ff->local)
{
......@@ -276,7 +276,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
else
mutt_format_s (dest, destlen, fmt, "");
break;
case 'l':
if (folder->ff->local)
{
......@@ -389,7 +389,7 @@ static void add_folder (MUTTMENU *m, struct browser_state *state,
(state->entry)[state->entrylen].gid = s->st_gid;
(state->entry)[state->entrylen].uid = s->st_uid;
(state->entry)[state->entrylen].nlink = s->st_nlink;
(state->entry)[state->entrylen].local = 1;
}
......@@ -467,7 +467,7 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state,
{
if (mutt_strcmp (de->d_name, ".") == 0)
continue; /* we don't need . */
if (prefix && *prefix && mutt_strncmp (prefix, de->d_name, mutt_strlen (prefix)) != 0)
continue;
if (!((regexec (Mask.rx, de->d_name, 0, NULL, 0) == 0) ^ Mask.not))
......@@ -476,13 +476,13 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state,
mutt_concat_path (buffer, d, de->d_name, sizeof (buffer));
if (lstat (buffer, &s) == -1)
continue;
/* No size for directories or symlinks */
if (S_ISDIR (s.st_mode) || S_ISLNK (s.st_mode))
s.st_size = 0;
else if (! S_ISREG (s.st_mode))
continue;
tmp = Incoming;
while (tmp && mutt_strcmp (buffer, tmp->path))
tmp = tmp->next;
......@@ -494,7 +494,7 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state,
}
add_folder (menu, state, de->d_name, &s, tmp);
}
closedir (dp);
closedir (dp);
browser_sort (state);
return 0;
}
......@@ -578,8 +578,8 @@ static void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num)
folder.ff = &((struct folder_file *) menu->data)[num];
folder.num = num;
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), folder_format_str,
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), folder_format_str,
(unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
}
......@@ -598,7 +598,7 @@ static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
menu->top = 0;
menu->tagged = 0;
if (buffy)
snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
else
......@@ -626,10 +626,10 @@ static int file_tag (MUTTMENU *menu, int n, int m)
mutt_error _("Can't attach a directory!");
return 0;
}
ot = ff->tagged;
ff->tagged = (m >= 0 ? m : !ff->tagged);
return ff->tagged - ot;
}