From 10ef38d440c8e4939330881972ed53049628af58 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sun, 12 Mar 2017 02:09:10 +0000 Subject: [PATCH] delete trailing whitespace --- ABOUT-NLS | 2 +- ChangeLog | 4 +- INSTALL | 6 +- LICENSE.md | 12 +- NEWS | 2 +- README.SSL | 10 +- TODO | 2 +- UPDATING | 6 +- UPDATING.kz | 6 +- account.c | 10 +- account.h | 8 +- addrbook.c | 26 +- alias.c | 58 ++-- ascii.c | 22 +- ascii.h | 10 +- attach.c | 130 +++---- attach.h | 8 +- base64.c | 22 +- browser.c | 70 ++-- browser.h | 8 +- buffer.c | 10 +- buffer.h | 4 +- buffy.c | 32 +- buffy.h | 10 +- charset.c | 26 +- color.c | 74 ++-- commands.c | 120 +++---- complete.c | 10 +- compose.c | 78 ++--- contrib/ca-bundle.crt | 248 +++++++------- contrib/gpg.rc | 4 +- contrib/hcache-bench/README.md | 2 +- contrib/hcache-bench/neomutt-hcache-bench.sh | 4 +- contrib/iconv/make.sh | 2 +- contrib/keybase/install.sh | 2 +- contrib/language.txt | 2 +- contrib/patch.slang-1.2.2.keypad.1 | 20 +- contrib/pgp5.rc | 2 +- contrib/sample.muttrc | 2 +- contrib/sample.muttrc-tlr | 10 +- contrib/smime_keys_test.pl | 8 +- copy.c | 70 ++-- copy.h | 8 +- crypt-gpgme.c | 340 +++++++++---------- crypt-gpgme.h | 6 +- crypt-mod-pgp-classic.c | 8 +- crypt-mod-pgp-gpgme.c | 8 +- crypt-mod-smime-classic.c | 10 +- crypt-mod-smime-gpgme.c | 10 +- crypt-mod.c | 4 +- crypt-mod.h | 14 +- crypt.c | 96 +++--- cryptglue.c | 18 +- curs_lib.c | 32 +- curs_main.c | 2 +- date.c | 10 +- doc/Muttrc.head | 2 +- doc/PGP-Notes.txt | 20 +- doc/devel-notes.txt | 4 +- doc/dotlock.man | 54 +-- doc/makedoc.c | 92 ++--- doc/mutt-1.7.0-syntax.vim | 16 +- doc/mutt.man | 22 +- doc/mutt.pwl | 2 +- doc/muttrc.man.head | 30 +- doc/patch-notes.txt | 22 +- dotlock.c | 158 ++++----- dotlock.h | 14 +- edit.c | 16 +- editmsg.c | 28 +- enter.c | 46 +-- extlib.c | 10 +- filter.c | 14 +- filter.h | 4 +- flags.c | 20 +- from.c | 16 +- globals.h | 10 +- gnupgparse.c | 20 +- handler.c | 118 +++---- hash.c | 12 +- hash.h | 4 +- hcache.h | 2 +- hdrline.c | 24 +- headers.c | 16 +- help.c | 24 +- history.c | 20 +- history.h | 8 +- hook.c | 4 +- imap/TODO | 2 +- imap/auth.c | 14 +- imap/auth.h | 8 +- imap/auth_anon.c | 10 +- imap/auth_cram.c | 16 +- imap/auth_gss.c | 24 +- imap/auth_login.c | 10 +- imap/auth_plain.c | 2 +- imap/auth_sasl.c | 16 +- imap/browse.c | 24 +- imap/command.c | 40 +-- imap/imap.h | 8 +- imap/imap_private.h | 14 +- imap/message.h | 8 +- imap/utf7.c | 8 +- init.c | 172 +++++----- intl/COPYING.LIB-2 | 2 +- intl/COPYING.LIB-2.1 | 2 +- intl/bindtextdom.c | 2 +- intl/locale.alias | 2 +- keymap.c | 44 +-- keymap.h | 12 +- lib.c | 118 +++---- lib.h | 10 +- m4/gpgme.m4 | 8 +- mailbox.h | 8 +- main.c | 22 +- mapping.h | 8 +- mbox.c | 60 ++-- menu.c | 58 ++-- mh.c | 98 +++--- mime.h | 8 +- mutt.h | 36 +- mutt_crypt.h | 20 +- mutt_curses.h | 8 +- mutt_idna.c | 8 +- mutt_idna.h | 8 +- mutt_menu.h | 12 +- mutt_regex.h | 8 +- mutt_sasl.c | 22 +- mutt_sasl.h | 10 +- mutt_socket.c | 38 +-- mutt_socket.h | 8 +- mutt_ssl.h | 8 +- muttlib.c | 144 ++++---- mx.c | 78 ++--- mx.h | 6 +- myvar.h | 4 +- pager.c | 104 +++--- pager.h | 8 +- parse.c | 100 +++--- pattern.c | 50 +-- pgp.c | 230 ++++++------- pgp.h | 18 +- pgpinvoke.c | 68 ++-- pgpkey.c | 28 +- pgplib.c | 16 +- pgplib.h | 4 +- pgpmicalg.c | 50 +-- pgppacket.c | 6 +- pgppacket.h | 8 +- pgppubring.c | 84 ++--- pop.c | 12 +- pop.h | 8 +- pop_auth.c | 8 +- pop_lib.c | 6 +- protos.h | 12 +- query.c | 32 +- recvattach.c | 102 +++--- recvcmd.c | 186 +++++----- regex.c | 14 +- remailer.c | 190 +++++------ remailer.h | 8 +- resize.c | 8 +- rfc1524.c | 88 ++--- rfc1524.h | 8 +- rfc2047.c | 30 +- rfc2047.h | 8 +- rfc2231.c | 64 ++-- rfc3676.c | 8 +- rfc3676.h | 8 +- rfc822.c | 26 +- rfc822.h | 8 +- safe_asprintf.c | 8 +- score.c | 10 +- send.c | 184 +++++----- signal.c | 10 +- smime.c | 172 +++++----- smime.h | 4 +- smtp.c | 2 +- sort.c | 12 +- sort.h | 8 +- status.c | 14 +- system.c | 8 +- thread.c | 50 +-- url.c | 8 +- url.h | 2 +- utf8.c | 2 +- 186 files changed, 2969 insertions(+), 2969 deletions(-) diff --git a/ABOUT-NLS b/ABOUT-NLS index 5fde45a0b..ab7349804 100644 --- a/ABOUT-NLS +++ b/ABOUT-NLS @@ -227,7 +227,7 @@ translation percentage of at least 50%. +----------------------------------------------------+ bg cs da de el en eo es et fi fr gl he hr id it ja 0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18 - + ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh +----------------------------------------------------+ a2ps | [] [] [] | 6 diff --git a/ChangeLog b/ChangeLog index ac345e147..73a172bac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13162,7 +13162,7 @@ (fallout from conversion from article to book). * UPDATING: Use +/-/! instead of N/D/M in UPDATING. - + 2006-05-19 18:30:10 Rocco Rutte (brendan) * Makefile.am, README, UPDATING: The UPDATING document is supposed @@ -13656,7 +13656,7 @@ destabilised things. Time for some brave (or lazy non-Changelog-reading) testers to report... next up, IDLE support. - + 2005-12-10 07:06:44 Brendan Cully (brendan) * imap/browse.c, imap/command.c, imap/imap.c, imap/imap_private.h, diff --git a/INSTALL b/INSTALL index a556d22e5..d3f1b4022 100644 --- a/INSTALL +++ b/INSTALL @@ -118,7 +118,7 @@ to ``configure'' to help it out, or change the default behavior: --disable-nls This switch disables mutt's native language support. ---with-included-gettext +--with-included-gettext Mutt will be built using the GNU gettext library included in the intl/ sub-directory. You may need to use this switch if your machine has something which looks like gettext to the @@ -131,13 +131,13 @@ to ``configure'' to help it out, or change the default behavior: routines, so this provides a way to support them. --enable-flock - use flock() to lock files. + use flock() to lock files. --disable-fcntl by default, Mutt uses fcntl() to lock files. Over NFS this can result in poor performance on read/write. Note that using this option could be dangerous if dotlocking is also disabled. - + --enable-nfs-fix some implementations of NFS do not always write the atime/mtime of small files. This means that Mutt's ``mailboxes'' diff --git a/LICENSE.md b/LICENSE.md index 0daa04150..4f3422f22 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,8 +1,8 @@ GNU General Public License ========================== -_Version 2, June 1991_ -_Copyright © 1989, 1991 Free Software Foundation, Inc.,_ +_Version 2, June 1991_ +_Copyright © 1989, 1991 Free Software Foundation, Inc.,_ _51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_ Everyone is permitted to copy and distribute verbatim copies @@ -289,17 +289,17 @@ the “copyright” line and a pointer to where the full notice is found. Copyright (C) - + 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. @@ -325,7 +325,7 @@ necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. - + , 1 April 1989 Ty Coon, President of Vice diff --git a/NEWS b/NEWS index b46391450..1f105c03b 100644 --- a/NEWS +++ b/NEWS @@ -115,7 +115,7 @@ Other changes verified if the output from $pgp_verify_command matches this regular expression. It's suggested that you set this variable to the typical text message output by PGP (or GPG, or whatever) - produces when it encounters a good signature. + produces when it encounters a good signature. - There's a new function, check-traditional-pgp, which is bound to esc-P by default. It'll check whether a text parts of a message diff --git a/README.SSL b/README.SSL index 90290e08c..221525e05 100644 --- a/README.SSL +++ b/README.SSL @@ -1,4 +1,4 @@ -IMAP/SSL in mutt +IMAP/SSL in mutt ================ Compilation @@ -40,7 +40,7 @@ generates unpredictable output, for example 'ps aluxww' in Linux, and calculating the MD5-sum from the output and saving it in a file. ** Note: The contents of the file pointed by $RANDFILE environment -** variable (or ~/.rnd if unset) will be overwritten every time Mutt +** variable (or ~/.rnd if unset) will be overwritten every time Mutt ** is run so don't put anything you can't afford to lose in that file. The files Mutt will try to use to initialize SSL library with are files @@ -63,7 +63,7 @@ you are asked to verify it. If you reject the certificate, the connection will be terminated immediately. If you accept the certificate, the connection will be established. Accepted certificates can also be saved so that further connections to the server are -automatically accepted. +automatically accepted. If OpenSSL was built with support for ServerNameIndication (SNI) and TLS is used in the negotiation, mutt will send its idea of the server-name @@ -105,7 +105,7 @@ each of these, you use the following: You can also combine the options until you get a successful connect. Once you know which options do not work, you can set the variables for non-working -protocols to know. The variables for the protocols are ssl_use_tlsv1, +protocols to know. The variables for the protocols are ssl_use_tlsv1, ssl_use_sslv2, and ssl_use_sslv3. To verify TLS SNI support by a server, you can use: @@ -113,7 +113,7 @@ To verify TLS SNI support by a server, you can use: -tls1 -servername --- +-- Tommi Komulainen Tommi.Komulainen@iki.fi diff --git a/TODO b/TODO index 76d834e1f..a02b4caa9 100644 --- a/TODO +++ b/TODO @@ -45,7 +45,7 @@ Problems are listed in approximate order of priority. - make patterns generic (I have patches for this -tlr), and introduce generic menu limiting, menu pattern searching, and the - like. + like. Note: This still requires some thought, since we'd have to store per-entry data in the menu structure. As an alternative, we could diff --git a/UPDATING b/UPDATING index ac3000b7f..63bfd6e9f 100644 --- a/UPDATING +++ b/UPDATING @@ -262,13 +262,13 @@ The keys used are: - $imap_cachedir replaced with $message_cachedir + Header/body caching for POP ($message_cachedir) - + Header caching for MH folders + + Header caching for MH folders ! $record now defaults to ~/sent ! $imap_idle now defaults to "yes" instead of "no" + Tab-completion for $my_* variable names and values + Expansion of mutt variables (except shell escape) - + Self-defined variables with $my_* prefix - + Pattern group support + + Self-defined variables with $my_* prefix + + Pattern group support + $imap_cachedir + 'old' flag on IMAP folders + SASL-IR support for IMAP diff --git a/UPDATING.kz b/UPDATING.kz index 1df36c0df..052324924 100644 --- a/UPDATING.kz +++ b/UPDATING.kz @@ -1,15 +1,15 @@ 1.6.0.1: + rebase to mutt upstream 1.6.0 -+ update to the new sidebar implementation. Note that all .muttrc options ++ update to the new sidebar implementation. Note that all .muttrc options are prefixed by "sidebar_" now. + rebase is based on neomutt project (see https://github.com/neomutt) where are maintained all non-upstream mutt changes, so it's easy to merge another features like "trash", "ifdef", ... to mutt-kz. -+ the stable mutt-kz releases and tags are maintained in stable/v branches, - the master branch is going to be *rebased*. This development model help us to be ++ the stable mutt-kz releases and tags are maintained in stable/v branches, + the master branch is going to be *rebased*. This development model help us to be up to date with mutt upstream. diff --git a/account.c b/account.c index 16f13ccd9..d6e2c2a9e 100644 --- a/account.c +++ b/account.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2007 Brendan Cully - * + * * 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 - + #ifdef USE_NNTP if (a1->type == MUTT_ACCT_TYPE_NNTP && NntpUser) user = NntpUser; diff --git a/account.h b/account.h index c38b592ce..9f4869087 100644 --- a/account.h +++ b/account.h @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2007,2012 Brendan Cully - * + * * 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) */ diff --git a/addrbook.c b/addrbook.c index 07eb9c69d..70eca9619 100644 --- a/addrbook.c +++ b/addrbook.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2007 Michael R. Elkins - * + * * 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,16 +139,16 @@ 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!")); return; } - + /* tell whoever called me to redraw the screen when I return */ set_option (OPTNEEDREDRAW); - + menu = mutt_new_menu (MENU_ALIAS); menu->make_entry = alias_entry; menu->tag = alias_tag; @@ -158,7 +158,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) { @@ -192,7 +192,7 @@ new_aliases: aliases = aliases->next; goto new_aliases; } - + switch ((op = mutt_menuLoop (menu))) { case OP_DELETE: @@ -239,5 +239,5 @@ new_aliases: mutt_menuDestroy (&menu); FREE (&AliasTable); - + } diff --git a/alias.c b/alias.c index fd59bb689..ac524d6d3 100644 --- a/alias.c +++ b/alias.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002 Michael R. Elkins - * + * * 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" @@ -45,7 +45,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) @@ -53,7 +53,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) { @@ -94,10 +94,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 @@ -146,7 +146,7 @@ void mutt_expand_aliases_env (ENVELOPE *env) } -/* +/* * if someone has an address like * From: Michael `/bin/rm -f ~` Elkins * and the user creates an alias for this, Mutt could wind up executing @@ -159,10 +159,10 @@ void mutt_expand_aliases_env (ENVELOPE *env) * since that would get aliased as * alias me Michael \\`/bin/rm -f ~\\` Elkins * 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. */ @@ -256,7 +256,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]) @@ -268,7 +268,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)) @@ -276,24 +276,24 @@ retry_name: case MUTT_YES: strfcpy (buf, fixed, sizeof (buf)); goto retry_name; - case MUTT_ABORT: + case MUTT_ABORT: 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]) @@ -301,7 +301,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)) @@ -312,7 +312,7 @@ retry_name: } } while(new->addr == NULL); - + if (adr && adr->personal && !mutt_is_mail_list (adr)) strfcpy (buf, adr->personal, sizeof (buf)); else @@ -335,7 +335,7 @@ retry_name: } mutt_alias_add_reverse (new); - + if ((t = Aliases)) { while (t->next) @@ -390,14 +390,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. */ @@ -451,7 +451,7 @@ ADDRESS *alias_reverse_lookup (ADDRESS *a) { if (!a || !a->mailbox) return NULL; - + return hash_find (ReverseAlias, a->mailbox); } @@ -582,10 +582,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 @@ -597,18 +597,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; } @@ -673,7 +673,7 @@ int mutt_addr_is_user (ADDRESS *addr) else return 1; } - + mutt_debug (5, "mutt_addr_is_user: no, all failed.\n"); return 0; } diff --git a/ascii.c b/ascii.c index 16003bb49..5d2e25343 100644 --- a/ascii.c +++ b/ascii.c @@ -1,27 +1,27 @@ /* * Copyright (C) 2001 Thomas Roessler - * + * * 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. */ @@ -37,14 +37,14 @@ 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 = tolower (*a) - tolower (*b))) @@ -55,26 +55,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 = tolower (*a) - tolower (*b))) return i; } - + return 0; } diff --git a/ascii.h b/ascii.h index 35ee2b60f..56e18fbdd 100644 --- a/ascii.h +++ b/ascii.h @@ -1,27 +1,27 @@ /* * Copyright (C) 2001-2002 Thomas Roessler - * + * * 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. */ diff --git a/attach.c b/attach.c index 4bf455cf1..e5572eef4 100644 --- a/attach.c +++ b/attach.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2002,2013 Michael R. Elkins * Copyright (C) 1999-2004,2006 Thomas Roessler - * + * * 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" @@ -50,16 +50,16 @@ int mutt_get_tmp_attachment (BODY *a) char tempfile[_POSIX_PATH_MAX]; FILE *fpin = NULL, *fpout = NULL; struct stat st; - + if(a->unlink) return 0; rfc1524_entry *entry = rfc1524_new_entry(); snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype); rfc1524_mailcap_lookup(a, type, entry, 0); - rfc1524_expand_filename(entry->nametemplate, a->filename, + rfc1524_expand_filename(entry->nametemplate, a->filename, tempfile, sizeof(tempfile)); - + rfc1524_free_entry(&entry); if(stat(a->filename, &st) == -1) @@ -76,10 +76,10 @@ int mutt_get_tmp_attachment (BODY *a) } else mutt_perror(fpin ? tempfile : a->filename); - + if(fpin) safe_fclose (&fpin); if(fpout) safe_fclose (&fpout); - + return a->unlink ? 0 : -1; } @@ -93,7 +93,7 @@ int mutt_compose_attachment (BODY *a) rfc1524_entry *entry = rfc1524_new_entry (); short unlink_newfile = 0; int rc = 0; - + snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); if (rfc1524_mailcap_lookup (a, type, entry, MUTT_COMPOSE)) { @@ -102,7 +102,7 @@ int mutt_compose_attachment (BODY *a) if (entry->composetypecommand) strfcpy (command, entry->composetypecommand, sizeof (command)); - else + else strfcpy (command, entry->composecommand, sizeof (command)); if (rfc1524_expand_filename (entry->nametemplate, a->filename, newfile, sizeof (newfile))) @@ -118,7 +118,7 @@ int mutt_compose_attachment (BODY *a) } else strfcpy(newfile, a->filename, sizeof(newfile)); - + if (rfc1524_expand_command (a, newfile, type, command, sizeof (command))) { @@ -132,7 +132,7 @@ int mutt_compose_attachment (BODY *a) mutt_endwin (NULL); if ((r = mutt_system (command)) == -1) mutt_error (_("Error running \"%s\"!"), command); - + if (r != -1 && entry->composetypecommand) { BODY *b; @@ -166,7 +166,7 @@ int mutt_compose_attachment (BODY *a) b->form_name = NULL; } - /* Remove headers by copying out data to another file, then + /* Remove headers by copying out data to another file, then * copying the file back */ fseeko (fp, b->offset, 0); mutt_mktemp (tempfile, sizeof (tempfile)); @@ -178,8 +178,8 @@ int mutt_compose_attachment (BODY *a) mutt_copy_stream (fp, tfp); safe_fclose (&fp); safe_fclose (&tfp); - mutt_unlink (a->filename); - if (mutt_rename_file (tempfile, a->filename) != 0) + mutt_unlink (a->filename); + if (mutt_rename_file (tempfile, a->filename) != 0) { mutt_perror (_("Failure to rename file.")); goto bailout; @@ -200,9 +200,9 @@ int mutt_compose_attachment (BODY *a) } rc = 1; - + bailout: - + if(unlink_newfile) unlink(newfile); @@ -210,8 +210,8 @@ int mutt_compose_attachment (BODY *a) return rc; } -/* - * Currently, this only works for send mode, as it assumes that the +/* + * Currently, this only works for send mode, as it assumes that the * BODY->filename actually contains the information. I'm not sure * we want to deal with editing attachments we've already received, * so this should be ok. @@ -227,7 +227,7 @@ int mutt_edit_attachment (BODY *a) rfc1524_entry *entry = rfc1524_new_entry (); short unlink_newfile = 0; int rc = 0; - + snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); if (rfc1524_mailcap_lookup (a, type, entry, MUTT_EDIT)) { @@ -281,12 +281,12 @@ int mutt_edit_attachment (BODY *a) } rc = 1; - + bailout: - + if(unlink_newfile) unlink(newfile); - + rfc1524_free_entry (&entry); return rc; } @@ -299,7 +299,7 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) for (; t; t = t->next) { i = mutt_strlen (t->data) - 1; - if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && + if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && ascii_strncasecmp (type, t->data, i) == 0) || ascii_strcasecmp (type, t->data) == 0) { @@ -319,9 +319,9 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) mutt_debug (1, "mutt_check_lookup_list: \"%s\" -> %s\n", b->filename, type); } - if (tmp.subtype) + if (tmp.subtype) FREE (&tmp.subtype); - if (tmp.xtype) + if (tmp.xtype) FREE (&tmp.xtype); } } @@ -344,7 +344,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, rfc1524_entry *entry = NULL; int rc = -1; int unlink_tempfile = 0; - + is_message = mutt_is_message_type(a->type, a->subtype); if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) && !crypt_valid_passphrase(a->hdr->security)) @@ -352,10 +352,10 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, use_mailcap = (flag == MUTT_MAILCAP || (flag == MUTT_REGULAR && mutt_needs_mailcap (a))); snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); - + if (use_mailcap) { - entry = rfc1524_new_entry (); + entry = rfc1524_new_entry (); if (!rfc1524_mailcap_lookup (a, type, entry, 0)) { if (flag == MUTT_REGULAR) @@ -370,7 +370,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, goto return_error; } } - + if (use_mailcap) { if (!entry->command) @@ -379,7 +379,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, goto return_error; } strfcpy (command, entry->command, sizeof (command)); - + if (fp) { fname = safe_strdup (a->filename); @@ -407,7 +407,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, } else if (fp == NULL) /* send case */ strfcpy (tempfile, a->filename, sizeof (tempfile)); - + if (fp) { /* recv case: we need to save the attachment to a file */ @@ -420,7 +420,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, command, sizeof (command)); use_pager = entry->copiousoutput; } - + if (use_pager) { if (fp && !use_mailcap && a->filename) @@ -432,12 +432,12 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, else mutt_mktemp (pagerfile, sizeof (pagerfile)); } - + if (use_mailcap) { pid_t thepid = 0; int tempfd = -1, pagerfd = -1; - + if (!use_pager) mutt_endwin (NULL); @@ -461,7 +461,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, { if(pagerfd != -1) close(pagerfd); - + if(tempfd != -1) close(tempfd); @@ -552,7 +552,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, } unset_option (OPTVIEWATTACH); } - + if (a->description) strfcpy (descrip, a->description, sizeof (descrip)); else if (a->filename) @@ -561,13 +561,13 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, else snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type); } - + /* We only reach this point if there have been no errors */ if (use_pager) { pager_t info; - + memset (&info, 0, sizeof (info)); info.fp = fp; info.bdy = a; @@ -584,7 +584,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, rc = 0; return_error: - + if (entry) rfc1524_free_entry (&entry); if (fp && tempfile[0]) @@ -604,7 +604,7 @@ int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile) pid_t thepid; int out = -1; int rv = 0; - + if (outfile && *outfile) if ((out = safe_open (outfile, O_CREAT | O_EXCL | O_WRONLY)) < 0) { @@ -634,7 +634,7 @@ int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile) mutt_perror (_("Can't create filter")); goto bail; } - + s.fpin = fp; mutt_decode_attachment (b, &s); safe_fclose (&s.fpout); @@ -667,16 +667,16 @@ int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile) safe_fclose (&ifp); goto bail; } - + mutt_copy_stream (ifp, ofp); safe_fclose (&ofp); safe_fclose (&ifp); } rv = 1; - + bail: - + if (outfile && *outfile) close (out); @@ -698,7 +698,7 @@ mutt_save_attachment_open (char *path, int flags) return fopen (path, "a"); if (flags == MUTT_SAVE_OVERWRITE) return fopen (path, "w"); /* __FOPEN_CHECKED__ */ - + return safe_fopen (path, "w"); } @@ -707,7 +707,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) { if (fp) { - + /* recv mode */ if(hdr && @@ -724,7 +724,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) MESSAGE *msg; int chflags = 0; int r = -1; - + hn = m->hdr; hn->msgno = hdr->msgno; /* required for MH/maildir */ hn->read = 1; @@ -742,7 +742,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) if (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF) chflags = CH_FROM | CH_UPDATE_LEN; chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE); - if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0 + if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0 && mx_commit_message (msg, &ctx) == 0) r = 0; else @@ -755,9 +755,9 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) else { /* In recv mode, extract from folder and decode */ - + STATE s; - + memset (&s, 0, sizeof (s)); if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL) { @@ -767,7 +767,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) } fseeko ((s.fpin = fp), m->offset, 0); mutt_decode_attachment (m, &s); - + if (safe_fsync_close (&s.fpout) != 0) { mutt_perror ("fclose"); @@ -787,7 +787,7 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr) mutt_perror ("fopen"); return (-1); } - + if ((nfp = mutt_save_attachment_open (path, flags)) == NULL) { mutt_perror ("fopen"); @@ -861,7 +861,7 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path, saved_encoding = m->encoding; if (!is_multipart (m)) m->encoding = ENC8BIT; - + m->length = st.st_size; m->offset = 0; saved_parts = m->parts; @@ -902,7 +902,7 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path, /* Ok, the difference between send and receive: * recv: BODY->filename is a suggested name, and Context|HEADER points * to the attachment in mailbox which is encoded - * send: BODY->filename points to the un-encoded file which contains the + * send: BODY->filename points to the un-encoded file which contains the * attachment */ @@ -913,17 +913,17 @@ int mutt_print_attachment (FILE *fp, BODY *a) pid_t thepid; FILE *ifp, *fpout; short unlink_newfile = 0; - + snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); - if (rfc1524_mailcap_lookup (a, type, NULL, MUTT_PRINT)) + if (rfc1524_mailcap_lookup (a, type, NULL, MUTT_PRINT)) { char command[_POSIX_PATH_MAX+STRING]; rfc1524_entry *entry; int piped = false; mutt_debug (2, "Using mailcap...\n"); - + entry = rfc1524_new_entry (); rfc1524_mailcap_lookup (a, type, entry, MUTT_PRINT); if (rfc1524_expand_filename (entry->nametemplate, a->filename, @@ -1002,17 +1002,17 @@ int mutt_print_attachment (FILE *fp, BODY *a) /* decode and print */ int rc = 0; - + ifp = NULL; fpout = NULL; - + mutt_mktemp (newfile, sizeof (newfile)); if (mutt_decode_save_attachment (fp, a, newfile, MUTT_PRINTING, 0) == 0) { - + mutt_debug (2, "successfully decoded %s type attachment to %s\n", type, newfile); - + if ((ifp = fopen (newfile, "r")) == NULL) { mutt_perror ("fopen"); @@ -1020,7 +1020,7 @@ int mutt_print_attachment (FILE *fp, BODY *a) } mutt_debug (2, "successfully opened %s read-only\n", newfile); - + mutt_endwin (NULL); if ((thepid = mutt_create_filter (NONULL(PrintCmd), &fpout, NULL, NULL)) < 0) { @@ -1029,7 +1029,7 @@ int mutt_print_attachment (FILE *fp, BODY *a) } mutt_debug (2, "Filter created.\n"); - + mutt_copy_stream (ifp, fpout); safe_fclose (&fpout); diff --git a/attach.h b/attach.h index 071f22c5f..38c0d11a0 100644 --- a/attach.h +++ b/attach.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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 */ diff --git a/base64.c b/base64.c index 2e59f33ab..375e67bcb 100644 --- a/base64.c +++ b/base64.c @@ -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 . - * + * * 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 diff --git a/browser.c b/browser.c index 96dee7d90..8d370e912 100644 --- a/browser.c +++ b/browser.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2007,2010,2013 Michael R. Elkins - * + * * 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" @@ -231,9 +231,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 @@ -259,7 +259,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) @@ -288,7 +288,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; @@ -309,7 +309,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; } @@ -336,12 +336,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) { @@ -356,7 +356,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) { @@ -573,7 +573,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; } else @@ -683,7 +683,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)) @@ -692,11 +692,11 @@ 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; - + if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) && (! S_ISLNK (s.st_mode))) continue; - + tmp = Incoming; while (tmp && mutt_strcmp (buffer, tmp->path)) tmp = tmp->next; @@ -708,7 +708,7 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *state, } add_folder (menu, state, de->d_name, NULL, &s, tmp, NULL); } - closedir (dp); + closedir (dp); } browser_sort (state); return 0; @@ -860,14 +860,14 @@ static void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num) folder.ff = &((struct folder_file *) menu->data)[num]; folder.num = num; - + #ifdef USE_NNTP if (option (OPTNEWS)) - mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(GroupFormat), newsgroup_format_str, + mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(GroupFormat), newsgroup_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR); else #endif - 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); } @@ -919,7 +919,7 @@ static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title, menu->top = 0; menu->tagged = 0; - + #ifdef USE_NNTP if (option (OPTNEWS)) { @@ -1002,10 +1002,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; } @@ -1046,7 +1046,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num char GotoSwapper[_POSIX_PATH_MAX] = ""; buffy = buffy && folder; - + memset (&state, 0, sizeof (struct browser_state)); #ifdef USE_NNTP @@ -1281,7 +1281,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num if (S_ISDIR (state.entry[menu->current].mode) || (S_ISLNK (state.entry[menu->current].mode) && - link_is_dir (LastDir, state.entry[menu->current].name)) + link_is_dir (LastDir, state.entry[menu->current].name)) #ifdef USE_IMAP || state.entry[menu->current].inferiors #endif @@ -1340,12 +1340,12 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { int n; ciss_url_t url; - + strfcpy (LastDir, state.entry[menu->current].name, sizeof (LastDir)); /* tack on delimiter here */ n = strlen (LastDir)+1; - + /* special case "" needs no delimiter */ url_parse_ciss (&url, state.entry[menu->current].name); if (url.path && @@ -1563,7 +1563,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } break; #endif - + case OP_CHANGE_DIRECTORY: #ifdef USE_NNTP @@ -1588,7 +1588,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), MUTT_FILE) == 0 && buf[0]) { - buffy = 0; + buffy = 0; mutt_expand_path (buf, sizeof (buf)); #ifdef USE_IMAP if (mx_is_imap (buf)) @@ -1642,7 +1642,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } MAYBE_REDRAW (menu->redraw); break; - + case OP_ENTER_MASK: strfcpy (buf, NONULL(Mask.pattern), sizeof (buf)); @@ -1716,7 +1716,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { int resort = 1; int reverse = (i == OP_SORT_REVERSE); - + switch (mutt_multi_choice ((reverse) ? /* L10N: The highlighted letters must match the "Sort" options */ _("Reverse sort by (d)ate, (a)lpha, si(z)e, d(e)scription, (c)ount, ne(w) count, or do(n)'t sort? ") : @@ -1862,12 +1862,12 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { mutt_error (_("Can't view a directory")); break; - } + } else { BODY *b; char buf[_POSIX_PATH_MAX]; - + mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf)); b = mutt_make_file_attach (buf); if (b != NULL) @@ -2084,9 +2084,9 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num #endif /* USE_IMAP */ } } - + bail: - + if (GotoSwapper[0]) GotoSwapper[0] = '\0'; } diff --git a/browser.h b/browser.h index 439be9d58..b5f8fd5bb 100644 --- a/browser.h +++ b/browser.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #ifndef _BROWSER_H #define _BROWSER_H 1 diff --git a/buffer.c b/buffer.c index ab587b5ad..42db5e7d2 100644 --- a/buffer.c +++ b/buffer.c @@ -3,12 +3,12 @@ * 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. @@ -64,7 +64,7 @@ BUFFER *mutt_buffer_from (char *seed) { void mutt_buffer_free (BUFFER **p) { - if (!p || !*p) + if (!p || !*p) return; FREE(&(*p)->data); @@ -76,7 +76,7 @@ int mutt_buffer_printf (BUFFER* buf, const char* fmt, ...) { va_list ap, ap_retry; int len, blen, doff; - + va_start (ap, fmt); va_copy (ap_retry, ap); @@ -271,7 +271,7 @@ int mutt_extract_token (BUFFER *dest, BUFFER *tok, int flags) /* if we got output, make a new string consisting of the shell output plus whatever else was left on the original line */ - /* BUT: If this is inside a quoted string, directly add output to + /* BUT: If this is inside a quoted string, directly add output to * the token */ if (expn.data && qc) { diff --git a/buffer.h b/buffer.h index a85aabe07..45c111803 100644 --- a/buffer.h +++ b/buffer.h @@ -3,12 +3,12 @@ * 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. diff --git a/buffy.c b/buffy.c index 5bcded465..f71d920c8 100644 --- a/buffy.c +++ b/buffy.c @@ -1,17 +1,17 @@ -/* +/* * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins * Copyright (C) 2016 Kevin J. McCarthy - * + * * 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. @@ -57,7 +57,7 @@ static short BuffyNotify = 0; /* # of unnotified new boxes */ static BUFFY* buffy_get (const char *path); -/* Find the last message in the file. +/* Find the last message in the file. * upon success return 0. If no message found - return -1 */ static int fseek_last_message (FILE * f) @@ -164,7 +164,7 @@ void mutt_buffy_cleanup (const char *buf, struct stat *st) { ut.actime = st->st_atime; ut.modtime = time (NULL); - utime (buf, &ut); + utime (buf, &ut); } else utime (buf, NULL); @@ -176,13 +176,13 @@ BUFFY *mutt_find_mailbox (const char *path) BUFFY *tmp = NULL; struct stat sb; struct stat tmp_sb; - + if (stat (path,&sb) != 0) return NULL; for (tmp = Incoming; tmp; tmp = tmp->next) { - if (stat (tmp->path,&tmp_sb) ==0 && + if (stat (tmp->path,&tmp_sb) ==0 && sb.st_dev == tmp_sb.st_dev && sb.st_ino == tmp_sb.st_ino) break; } @@ -757,7 +757,7 @@ int mutt_buffy_list (void) int first = 1; int have_unnotified = BuffyNotify; - + buffylist[0] = 0; pos += strlen (strncat (buffylist, _("New mail in "), sizeof (buffylist) - 1 - pos)); /* __STRNCAT_CHECKED__ */ for (tmp = Incoming; tmp; tmp = tmp->next) @@ -768,11 +768,11 @@ int mutt_buffy_list (void) strfcpy (path, tmp->path, sizeof (path)); mutt_pretty_mailbox (path, sizeof (path)); - + if (!first && (MuttMessageWindow->cols >= 7) && (pos + strlen (path) >= (size_t)MuttMessageWindow->cols - 7)) break; - + if (!first) pos += strlen (strncat(buffylist + pos, ", ", sizeof(buffylist)-1-pos)); /* __STRNCAT_CHECKED__ */ @@ -795,7 +795,7 @@ int mutt_buffy_list (void) mutt_message ("%s", buffylist); return (1); } - /* there were no mailboxes needing to be notified, so clean up since + /* there were no mailboxes needing to be notified, so clean up since * BuffyNotify has somehow gotten out of sync */ BuffyNotify = 0; @@ -823,7 +823,7 @@ int mutt_buffy_notify (void) return (0); } -/* +/* * mutt_buffy() -- incoming folders completion routine * * given a folder name, this routine gives the next incoming folder with new @@ -836,13 +836,13 @@ void mutt_buffy (char *s, size_t slen) mutt_expand_path (s, slen); - if (mutt_buffy_check (0)) + if (mutt_buffy_check (0)) { for (pass = 0; pass < 2; pass++) - for (tmp = Incoming; tmp; tmp = tmp->next) + for (tmp = Incoming; tmp; tmp = tmp->next) { mutt_expand_path (tmp->path, sizeof (tmp->path)); - if ((found || pass) && tmp->new) + if ((found || pass) && tmp->new) { strfcpy (s, tmp->path, slen); mutt_pretty_mailbox (s, slen); diff --git a/buffy.h b/buffy.h index a042484ae..08baa2b1a 100644 --- a/buffy.h +++ b/buffy.h @@ -1,16 +1,16 @@ -/* +/* * Copyright (C) 1996-2000,2010,2013 Michael R. Elkins - * + * * 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. @@ -21,7 +21,7 @@ /*parameter to mutt_parse_mailboxes*/ #define MUTT_MAILBOXES 1 -#define MUTT_UNMAILBOXES 2 +#define MUTT_UNMAILBOXES 2 typedef struct buffy_t { diff --git a/charset.c b/charset.c index 9f0ed03c7..20b63d5f0 100644 --- a/charset.c +++ b/charset.c @@ -41,7 +41,7 @@ # define EILSEQ EINVAL #endif -/* +/* * The following list has been created manually from the data under: * http://www.isi.edu/in-notes/iana/assignments/character-sets * Last update: 2000-09-07 @@ -50,7 +50,7 @@ * MIME name is given. */ -static const struct +static const struct { const char *key; const char *pref; @@ -223,10 +223,10 @@ void mutt_set_langinfo_charset (void) { char buff[LONG_STRING]; char buff2[LONG_STRING]; - + strfcpy (buff, nl_langinfo (CODESET), sizeof (buff)); mutt_canonical_charset (buff2, sizeof (buff2), buff); - + /* finally, set $charset */ if (!(Charset = safe_strdup (buff2))) Charset = safe_strdup ("iso-8859-1"); @@ -389,7 +389,7 @@ iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags) /* call system iconv with names it appreciates */ if ((cd = iconv_open (tocode2, fromcode2)) != (iconv_t) -1) return cd; - + return (iconv_t) -1; } @@ -497,12 +497,12 @@ int mutt_convert_string (char **ps, const char *from, const char *to, int flags) inrepls = repls; else outrepl = "?"; - + len = strlen (s); ib = s, ibl = len + 1; obl = MB_LEN_MAX * ibl; ob = buf = safe_malloc (obl + 1); - + mutt_iconv (cd, &ib, &ibl, &ob, &obl, inrepls, outrepl); iconv_close (cd); @@ -510,7 +510,7 @@ int mutt_convert_string (char **ps, const char *from, const char *to, int flags) FREE (ps); /* __FREE_CHECKED__ */ *ps = buf; - + mutt_str_adjust (ps); return 0; } @@ -575,20 +575,20 @@ char *fgetconvs (char *buf, size_t l, FGETCONV *_fc) { int c; size_t r; - + for (r = 0; r + 1 < l;) { if ((c = fgetconv (_fc)) == EOF) break; buf[r++] = (char) c; - if (c == '\n') + if (c == '\n') break; } buf[r] = '\0'; - - if (r) + + if (r) return buf; - else + else return NULL; } diff --git a/color.c b/color.c index d83d5d82d..aff73c8b0 100644 --- a/color.c +++ b/color.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2012 Michael R. Elkins - * + * * 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" @@ -135,15 +135,15 @@ static COLOR_LINE *mutt_new_color_line (void) COLOR_LINE *p = safe_calloc (1, sizeof (COLOR_LINE)); p->fg = p->bg = -1; - + return (p); } -static void mutt_free_color_line(COLOR_LINE **l, +static void mutt_free_color_line(COLOR_LINE **l, int free_colors) { COLOR_LINE *tmp; - + if(!l || !*l) return; @@ -157,7 +157,7 @@ static void mutt_free_color_line(COLOR_LINE **l, /* we should really introduce a container * type for regular expressions. */ - + regfree(&tmp->rx); mutt_pattern_free(&tmp->color_pattern); FREE (&tmp->pattern); @@ -206,7 +206,7 @@ static char *get_color_name (char *dest, size_t destlen, int val) case COLOR_WHITE: strfcpy (dest, missing[1], destlen); return dest; - + case COLOR_DEFAULT: strfcpy (dest, missing[2], destlen); return dest; @@ -234,7 +234,7 @@ int mutt_alloc_color (int fg, int bg) { COLOR_LIST *p = ColorList; int i; - + #if defined (USE_SLANG_CURSES) char fgc[SHORT_STRING], bgc[SHORT_STRING]; #endif @@ -397,8 +397,8 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err) * unmono index pattern [pattern...] */ -static int -_mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err, +static int +_mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err, short parse_uncolor); @@ -508,7 +508,7 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, if( #ifdef HAVE_COLOR /* we're running without curses */ - option (OPTNOCURSES) + option (OPTNOCURSES) || /* we're parsing an uncolor command, and have no colors */ (parse_uncolor && !has_colors()) /* we're parsing an unmono command, and have colors */ @@ -558,14 +558,14 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, } -static int +static int add_pattern (COLOR_LINE **top, const char *s, int sensitive, int fg, int bg, int attr, BUFFER *err, int is_index, int match) { /* is_index used to store compiled pattern - * only for `index' color object + * only for `index' color object * when called from mutt_parse_color() */ COLOR_LINE *tmp = *top; @@ -609,7 +609,7 @@ add_pattern (COLOR_LINE **top, const char *s, int sensitive, char buf[LONG_STRING]; tmp = mutt_new_color_line (); - if (is_index) + if (is_index) { int i; @@ -653,13 +653,13 @@ parse_object(BUFFER *buf, BUFFER *s, int *o, int *ql, BUFFER *err) { int q_level = 0; char *eptr; - + if(!MoreArgs(s)) { strfcpy(err->data, _("Missing arguments."), err->dsize); return -1; } - + mutt_extract_token(buf, s, 0); if(!mutt_strncmp(buf->data, "quoted", 6)) { @@ -674,7 +674,7 @@ parse_object(BUFFER *buf, BUFFER *s, int *o, int *ql, BUFFER *err) } else *ql = 0; - + *o = MT_COLOR_QUOTED; } else if ((*o = mutt_getvaluebyname (buf->data, Fields)) == -1) @@ -709,12 +709,12 @@ parse_color_pair(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *er strfcpy (err->data, _("color: too few arguments"), err->dsize); return (-1); } - + mutt_extract_token (buf, s, 0); if (parse_color_name (buf->data, bg, attr, 0, err) != 0) return (-1); - + return 0; } @@ -723,8 +723,8 @@ parse_color_pair(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *er static int parse_attr_spec(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *err) { - - if(fg) *fg = -1; + + if(fg) *fg = -1; if(bg) *bg = -1; if (! MoreArgs (s)) @@ -752,7 +752,7 @@ parse_attr_spec(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *err snprintf (err->data, err->dsize, _("%s: no such attribute"), buf->data); return (-1); } - + return 0; } @@ -766,12 +766,12 @@ static int fgbgattr_to_color(int fg, int bg, int attr) return attr; } -/* usage: color [ ] +/* usage: color [ ] * mono [ ] */ -static int -_mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, +static int +_mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, parser_callback_t callback, short dry_run) { int object = 0, attr = 0, fg = 0, bg = 0, q_level = 0; @@ -784,7 +784,7 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, return -1; /* extract a regular expression if needed */ - + if ((object == MT_COLOR_BODY) || (object == MT_COLOR_HEADER) || (object == MT_COLOR_ATTACH_HEADERS) || @@ -803,22 +803,22 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, mutt_extract_token (buf, s, 0); } - + if (MoreArgs (s) && (object != MT_COLOR_STATUS)) { strfcpy (err->data, _("too many arguments"), err->dsize); return (-1); } - + /* dry run? */ - + if(dry_run) { *s->dptr = '\0'; /* fake that we're done parsing */ return 0; } - + #ifdef HAVE_COLOR # ifdef HAVE_USE_DEFAULT_COLORS if (!option (OPTNOCURSES) && has_colors() @@ -831,7 +831,7 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, } # endif /* HAVE_USE_DEFAULT_COLORS */ #endif - + if (object == MT_COLOR_HEADER) r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err, 0, match); else if (object == MT_COLOR_BODY) @@ -907,7 +907,7 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, if (q_level == 0) { ColorDefs[MT_COLOR_QUOTED] = fgbgattr_to_color(fg, bg, attr); - + ColorQuote[0] = ColorDefs[MT_COLOR_QUOTED]; for (q_level = 1; q_level < ColorQuoteUsed; q_level++) { @@ -933,10 +933,10 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, int mutt_parse_color(BUFFER *buff, BUFFER *s, unsigned long data, BUFFER *err) { int dry_run = 0; - + if(option(OPTNOCURSES) || !has_colors()) dry_run = 1; - + return _mutt_parse_color(buff, s, err, parse_color_pair, dry_run); } @@ -945,7 +945,7 @@ int mutt_parse_color(BUFFER *buff, BUFFER *s, unsigned long data, BUFFER *err) int mutt_parse_mono(BUFFER *buff, BUFFER *s, unsigned long data, BUFFER *err) { int dry_run = 0; - + #ifdef HAVE_COLOR if(option(OPTNOCURSES) || has_colors()) dry_run = 1; diff --git a/commands.c b/commands.c index e0fd8be85..59f19768a 100644 --- a/commands.c +++ b/commands.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 2000-2004,2006 Thomas Roessler - * + * * 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" @@ -99,14 +99,14 @@ int mutt_display_message (HEADER *cur) } } } - + if (cmflags & MUTT_CM_VERIFY || cur->security & ENCRYPT) { if (cur->security & APPLICATION_PGP) { if (cur->env->from) crypt_pgp_invoke_getkeys (cur->env->from); - + crypt_invoke_message (APPLICATION_PGP); } @@ -122,7 +122,7 @@ int mutt_display_message (HEADER *cur) return (0); } - if (DisplayFilter && *DisplayFilter) + if (DisplayFilter && *DisplayFilter) { fpfilterout = fpout; fpout = NULL; @@ -176,13 +176,13 @@ int mutt_display_message (HEADER *cur) safe_fclose (&fpfilterout); /* XXX - check result? */ - + if (WithCrypto) { /* update crypto information for this message */ cur->security &= ~(GOODSIGN|BADSIGN); cur->security |= crypt_query (cur->content); - + /* Remove color cache for this message, in case there are color patterns for both ~g and ~V */ cur->pair = 0; @@ -192,7 +192,7 @@ int mutt_display_message (HEADER *cur) { pager_t info; - if (WithCrypto + if (WithCrypto && (cur->security & APPLICATION_SMIME) && (cmflags & MUTT_CM_VERIFY)) { if (cur->security & GOODSIGN) @@ -208,7 +208,7 @@ int mutt_display_message (HEADER *cur) mutt_error (_("S/MIME signature could NOT be verified.")); } - if (WithCrypto + if (WithCrypto && (cur->security & APPLICATION_PGP) && (cmflags & MUTT_CM_VERIFY)) { if (cur->security & GOODSIGN) @@ -286,7 +286,7 @@ void ci_bounce_message (HEADER *h, int *redraw) strfcpy(prompt, _("Bounce message to: "), sizeof(prompt)); else strfcpy(prompt, _("Bounce tagged messages to: "), sizeof(prompt)); - + rc = mutt_get_field (prompt, buf, sizeof (buf), MUTT_ALIAS); if (option (OPTNEEDREDRAW)) @@ -340,7 +340,7 @@ void ci_bounce_message (HEADER *h, int *redraw) } mutt_window_clearline (MuttMessageWindow, 0); - + rc = mutt_bounce_message (NULL, h, adr); rfc822_free_address (&adr); /* If no error, or background, display message. */ @@ -354,24 +354,24 @@ static void pipe_set_flags (int decode, int print, int *cmflags, int *chflags) { *cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV; *chflags |= CH_DECODE | CH_REORDER; - + if (option (OPTWEED)) { *chflags |= CH_WEED; *cmflags |= MUTT_CM_WEED; } } - + if (print) *cmflags |= MUTT_CM_PRINTING; - + } static void pipe_msg (HEADER *h, FILE *fp, int decode, int print) { int cmflags = 0; int chflags = CH_FROM; - + pipe_set_flags (decode, print, &cmflags, &chflags); if (WithCrypto && decode && h->security & ENCRYPT) @@ -396,14 +396,14 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, int split, char *sep) { - + int i, rc = 0; pid_t thepid; FILE *fpout; - -/* mutt_endwin (NULL); - is this really needed here ? +/* mutt_endwin (NULL); + + is this really needed here ? it makes the screen flicker on pgp and s/mime messages, before asking for a passphrase... Oliver Ehli */ @@ -425,7 +425,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, mutt_perror (_("Can't create filter process")); return 1; } - + pipe_msg (h, fpout, decode, print); safe_fclose (&fpout); rc = mutt_wait_filter (thepid); @@ -445,7 +445,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, return 1; } } - + if (split) { for (i = 0; i < Context->vcount; i++) @@ -509,7 +509,7 @@ void mutt_pipe_message (HEADER *h) mutt_expand_path (buffer, sizeof (buffer)); _mutt_pipe_message (h, buffer, option (OPTPIPEDECODE), - 0, + 0, option (OPTPIPESPLIT), PipeSep); } @@ -522,7 +522,7 @@ void mutt_print_message (HEADER *h) mutt_message (_("No printing command has been defined.")); return; } - + if (query_quadoption (OPT_PRINT, h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES) @@ -562,32 +562,32 @@ int mutt_select_sort (int reverse) case 2: /* (f)rm */ Sort = SORT_FROM; break; - + case 3: /* (r)ecv */ Sort = SORT_RECEIVED; break; - + case 4: /* (s)ubj */ Sort = SORT_SUBJECT; break; - + case 5: /* t(o) */ Sort = SORT_TO; break; - + case 6: /* (t)hread */ Sort = SORT_THREADS; break; - + case 7: /* (u)nsort */ Sort = SORT_ORDER; break; - + case 8: /* si(z)e */ Sort = SORT_SIZE; break; - - case 9: /* s(c)ore */ + + case 9: /* s(c)ore */ Sort = SORT_SCORE; break; @@ -666,14 +666,14 @@ void mutt_display_address (ENVELOPE *env) adr = mutt_get_address (env, &pfx); if (!adr) return; - - /* + + /* * Note: We don't convert IDNA to local representation this time. * That is intentional, so the user has an opportunity to copy & * paste the on-the-wire form of the address to other, IDN-unable - * software. + * software. */ - + buf[0] = 0; rfc822_write_address (buf, sizeof (buf), adr, 0); mutt_message ("%s: %s", pfx, buf); @@ -683,7 +683,7 @@ static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags, { *cmflags = 0; *chflags = CH_UPDATE_LEN; - + if (WithCrypto && !decode && decrypt && (hdr->security & ENCRYPT)) { if ((WithCrypto & APPLICATION_PGP) @@ -725,7 +725,7 @@ int _mutt_save_message (HEADER *h, CONTEXT *ctx, int delete, int decode, int dec { int cmflags, chflags; int rc; - + set_copy_flags (h, decode, decrypt, &cmflags, &chflags); if (decode || decrypt) @@ -741,12 +741,12 @@ int _mutt_save_message (HEADER *h, CONTEXT *ctx, int delete, int decode, int dec if (option (OPTDELETEUNTAG)) mutt_set_flag (Context, h, MUTT_TAG, 0); } - + return 0; } /* returns 0 if the copy/save was successful, or -1 on error/abort */ -int mutt_save_message (HEADER *h, int delete, +int mutt_save_message (HEADER *h, int delete, int decode, int decrypt, int *redraw) { int i, need_buffy_cleanup; @@ -757,7 +757,7 @@ int mutt_save_message (HEADER *h, int delete, *redraw = 0; - + snprintf (prompt, sizeof (prompt), decode ? (delete ? _("Decode-save%s to mailbox") : _("Decode-copy%s to mailbox")) : @@ -765,7 +765,7 @@ int mutt_save_message (HEADER *h, int delete, _("Decrypt-copy%s to mailbox")) : (delete ? _("Save%s to mailbox") : _("Copy%s to mailbox"))), h ? "" : _(" tagged")); - + if (h) { @@ -818,7 +818,7 @@ int mutt_save_message (HEADER *h, int delete, if (!buf[0]) return (-1); - + /* This is an undocumented feature of ELM pointed out to me by Felix von * Leitner */ @@ -836,11 +836,11 @@ int mutt_save_message (HEADER *h, int delete, if (WithCrypto && need_passphrase && (decode || decrypt) && !crypt_valid_passphrase(app)) return -1; - + mutt_message (_("Copying to %s..."), buf); - + #ifdef USE_IMAP - if (Context->magic == MUTT_IMAP && + if (Context->magic == MUTT_IMAP && !(decode || decrypt) && mx_is_imap (buf)) { switch (imap_copy_messages (Context, h, buf, delete)) @@ -934,7 +934,7 @@ int mutt_save_message (HEADER *h, int delete, mutt_clear_error (); return (0); } - + return -1; } @@ -956,7 +956,7 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) short charset_changed = 0; short type_changed = 0; - + cp = mutt_get_parameter ("charset", b->parameter); strfcpy (charset, NONULL (cp), sizeof (charset)); @@ -965,7 +965,7 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) if (b->parameter) { size_t l; - + for (p = b->parameter; p; p = p->next) { l = strlen (buf); @@ -974,18 +974,18 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) snprintf (buf + l, sizeof (buf) - l, "; %s=%s", p->attribute, tmp); } } - + if (mutt_get_field ("Content-Type: ", buf, sizeof (buf), 0) != 0 || buf[0] == 0) return; - + /* clean up previous junk */ mutt_free_parameter (&b->parameter); FREE (&b->subtype); - + mutt_parse_content_type (buf, b); - + snprintf (tmp, sizeof (tmp), "%s/%s", TYPE (b), NONULL (b->subtype)); type_changed = ascii_strcasecmp (tmp, obuf); charset_changed = ascii_strcasecmp (charset, mutt_get_parameter ("charset", b->parameter)); @@ -1002,7 +1002,7 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) } /* inform the user */ - + snprintf (tmp, sizeof (tmp), "%s/%s", TYPE (b), NONULL (b->subtype)); if (type_changed) mutt_message (_("Content-Type changed to %s."), tmp); @@ -1027,7 +1027,7 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp) if (fp && (is_multipart (b) || mutt_is_message_type (b->type, b->subtype))) mutt_parse_part (fp, b); - + if (WithCrypto && h) { if (h->content == b) @@ -1042,9 +1042,9 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw) { MESSAGE *msg; int rv = 0; - + h->security |= PGP_TRADITIONAL_CHECKED; - + mutt_parse_mime_message (Context, h); if ((msg = mx_open_message (Context, h->msgno)) == NULL) return 0; @@ -1054,7 +1054,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw) *redraw |= REDRAW_FULL; rv = 1; } - + h->security |= PGP_TRADITIONAL_CHECKED; mx_close_message (Context, &msg); return rv; @@ -1069,7 +1069,7 @@ int mutt_check_traditional_pgp (HEADER *h, int *redraw) else { for (i = 0; i < Context->vcount; i++) - if (Context->hdrs[Context->v2r[i]]->tagged && + if (Context->hdrs[Context->v2r[i]]->tagged && !(Context->hdrs[Context->v2r[i]]->security & PGP_TRADITIONAL_CHECKED)) rv = _mutt_check_traditional_pgp (Context->hdrs[Context->v2r[i]], redraw) || rv; diff --git a/complete.c b/complete.c index 55fcb309f..163ff11c3 100644 --- a/complete.c +++ b/complete.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2007 Michael R. Elkins - * + * * 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" @@ -131,7 +131,7 @@ int mutt_complete (char *s, size_t slen) if (mx_is_imap (imap_path)) return imap_complete (s, slen, imap_path); #endif - + if (*s == '=' || *s == '+' || *s == '!') { dirpart[0] = *s; diff --git a/compose.c b/compose.c index 08e7d00c5..768c856cd 100644 --- a/compose.c +++ b/compose.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2002,2007,2010,2012 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH - * + * * 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" @@ -218,13 +218,13 @@ static void redraw_mix_line (LIST *chain) mutt_window_clrtoeol (MuttIndexWindow); return; } - + for (c = 12; chain; chain = chain->next) { t = chain->data; if (t && t[0] == '0' && t[1] == '\0') t = ""; - + if (c + mutt_strlen (t) + 2 >= MuttIndexWindow->cols) break; @@ -254,13 +254,13 @@ check_attachments(ATTACHPTR **idx, short idxlen) pretty, i+1); return -1; } - + if(idx[i]->content->stamp < st.st_mtime) { mutt_pretty_mailbox(pretty, sizeof (pretty)); snprintf(msg, sizeof(msg), _("%s [#%d] modified. Update encoding?"), pretty, i+1); - + if((r = mutt_yesorno(msg, MUTT_YES)) == MUTT_YES) mutt_update_encoding(idx[i]->content); else if(r == MUTT_ABORT) @@ -330,7 +330,7 @@ static int edit_address_list (int line, ADDRESS **addr) { char buf[HUGE_STRING] = ""; /* needs to be large for alias expansion */ char *err = NULL; - + mutt_addrlist_to_local (*addr); rfc822_write_address (buf, sizeof (buf), *addr, 0); if (mutt_get_field (Prompts[line], buf, sizeof (buf), MUTT_ALIAS) == 0) @@ -358,7 +358,7 @@ static int edit_address_list (int line, ADDRESS **addr) rfc822_write_address (buf, sizeof (buf), *addr, 1); mutt_window_move (MuttIndexWindow, line, HDR_XOFFSET); mutt_paddstr (W, buf); - + return 0; } @@ -394,7 +394,7 @@ static int delete_attachment (MUTTMENU *menu, short *idxlen, int x) idx[x] = idx[x+1]; idx[*idxlen - 1] = NULL; menu->max = --(*idxlen); - + return (0); } @@ -411,13 +411,13 @@ static void update_idx (MUTTMENU *menu, ATTACHPTR **idx, short idxlen) } -/* +/* * cum_attachs_size: Cumulative Attachments Size * * Returns the total number of bytes used by the attachments in the * attachment list _after_ content-transfer-encodings have been * applied. - * + * */ static unsigned long cum_attachs_size (MUTTMENU *menu) @@ -427,7 +427,7 @@ static unsigned long cum_attachs_size (MUTTMENU *menu) ATTACHPTR **idx = menu->data; CONTENT *info; BODY *b; - + for (i = 0, s = 0; i < menu->max; i++) { b = idx[i]->content; @@ -456,16 +456,16 @@ static unsigned long cum_attachs_size (MUTTMENU *menu) } /* prototype for use below */ -static void compose_status_line (char *buf, size_t buflen, size_t col, int cols, MUTTMENU *menu, +static void compose_status_line (char *buf, size_t buflen, size_t col, int cols, MUTTMENU *menu, const char *p); /* * compose_format_str() * - * %a = total number of attachments + * %a = total number of attachments * %h = hostname [option] - * %l = approx. length of current message (in bytes) - * %v = Mutt version + * %l = approx. length of current message (in bytes) + * %v = Mutt version * * This function is similar to status_format_str(). Look at that function for * help when modifying this function. @@ -525,7 +525,7 @@ compose_format_str (char *buf, size_t buflen, size_t col, int cols, char op, con static void compose_status_line (char *buf, size_t buflen, size_t col, int cols, MUTTMENU *menu, const char *p) { - mutt_FormatString (buf, buflen, col, cols, p, compose_format_str, + mutt_FormatString (buf, buflen, col, cols, p, compose_format_str, (unsigned long) menu, 0); } @@ -634,7 +634,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ crypt_opportunistic_encrypt (msg); redraw_crypt_lines (msg); } - mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); + mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; #ifdef USE_NNTP case OP_COMPOSE_EDIT_NEWSGROUPS: @@ -784,13 +784,13 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ case OP_COMPOSE_ATTACH_KEY: if (!(WithCrypto & APPLICATION_PGP)) - break; + break; if (idxlen == idxmax) { safe_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5)); menu->data = idx; } - + idx[idxlen] = safe_calloc (1, sizeof (ATTACHPTR)); if ((idx[idxlen]->content = crypt_pgp_make_key_attachment(NULL)) != NULL) { @@ -807,7 +807,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ menu->redraw = REDRAW_FULL; unset_option(OPTNEEDREDRAW); } - + mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -851,7 +851,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ FREE (&idx[idxlen]); } } - + FREE (&files); if (!error) mutt_clear_error (); @@ -936,7 +936,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ this = Context; /* remember current folder and sort methods*/ oldSort = Sort; oldSortAux = SortAux; - + Context = ctx; set_option(OPTATTACHMSG); mutt_message (_("Tag the messages you want to attach!")); @@ -978,7 +978,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ } menu->redraw |= REDRAW_FULL; - if (close == OP_QUIT) + if (close == OP_QUIT) mx_close_mailbox (Context, NULL); else mx_fastclose_mailbox (Context); @@ -1016,9 +1016,9 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ break; #define CURRENT idx[menu->current]->content - + case OP_COMPOSE_TOGGLE_RECODE: - { + { CHECK_COUNT; if (!mutt_is_text_part (CURRENT)) { @@ -1070,7 +1070,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ } mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; - + case OP_COMPOSE_TOGGLE_DISPOSITION: /* toggle the content-disposition between inline/attachment */ idx[menu->current]->content->disposition = (idx[menu->current]->content->disposition == DISPINLINE) ? DISPATTACH : DISPINLINE; @@ -1114,19 +1114,19 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ /* Note: We don't invoke send2-hook here, since we want to leave * users an opportunity to change settings from the ":" prompt. */ - + if(check_attachments(idx, idxlen) != 0) { menu->redraw = REDRAW_FULL; break; } - + #ifdef MIXMASTER if (msg->chain && mix_check_message (msg) != 0) break; #endif - + if (!fccSet && *fcc) { if ((i = query_quadoption (OPT_COPY, @@ -1225,13 +1225,13 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ mutt_expand_path (fname, sizeof (fname)); if(mutt_rename_file (idx[menu->current]->content->filename, fname)) break; - + mutt_str_replace (&idx[menu->current]->content->filename, fname); menu->redraw = REDRAW_CURRENT; if(idx[menu->current]->content->stamp >= st.st_mtime) mutt_stamp_attachment(idx[menu->current]->content); - + } mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1252,7 +1252,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ /* Call to lookup_mime_type () ? maybe later */ type[0] = 0; - if (mutt_get_field ("Content-Type: ", type, sizeof (type), 0) != 0 + if (mutt_get_field ("Content-Type: ", type, sizeof (type), 0) != 0 || !type[0]) continue; @@ -1300,7 +1300,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ menu->redraw = REDRAW_FULL; } } - mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); + mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; case OP_COMPOSE_EDIT_MIME: @@ -1382,7 +1382,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ menu->redraw = REDRAW_FULL; break; } - + loop = 0; r = 1; break; @@ -1489,7 +1489,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ #ifdef MIXMASTER case OP_COMPOSE_MIX: - + mix_make_chain (&msg->chain, &menu->redraw); mutt_message_hook (NULL, msg, MUTT_SEND2HOOK); break; @@ -1498,7 +1498,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ } /* Draw formatted compose status line */ - if (menu->redraw & REDRAW_STATUS) + if (menu->redraw & REDRAW_STATUS) { compose_status_line (buf, sizeof (buf), 0, MuttStatusWindow->cols, menu, NONULL(ComposeFormat)); mutt_window_move (MuttStatusWindow, 0, 0); diff --git a/contrib/ca-bundle.crt b/contrib/ca-bundle.crt index 12b997d6d..50944074f 100644 --- a/contrib/ca-bundle.crt +++ b/contrib/ca-bundle.crt @@ -78,10 +78,10 @@ Certificate Ingredients: X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:08:20:6C:66:EB:81:0A:6C:5C:D5:B5:A6:3C:41:DD:1C:96:91:27:77 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 08:20:6C:66:EB:81:0A:6C:5C:D5:B5:A6:3C:41:DD:1C:96:91:27:77 Signature Algorithm: sha1WithRSAEncryption 5a:87:58:8f:2d:ab:76:21:6b:54:0c:d9:f1:41:f6:4e:cd:2b: @@ -149,23 +149,23 @@ Certificate Ingredients: 8d:38:26:b0:6f:43:6e:09:7d Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Digital Signature Trust Co./OU=DST (ANX Network) CA/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Dec 9 15:46:48 1998 GMT, Not After: Dec 9 15:46:48 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:8C:16:55:70:CC:16:0A:53:64:C2:A5:84:AA:B3:64:17:43:3F:82:36 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 8C:16:55:70:CC:16:0A:53:64:C2:A5:84:AA:B3:64:17:43:3F:82:36 - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: sha1WithRSAEncryption @@ -298,10 +298,10 @@ Certificate Ingredients: CA:TRUE, pathlen:5 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: 1.2.840.113807.10.1.5.1 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 57:47:35:7B:36:27:11:A8:08:FC:2F:46:25:EB:24:69 Signature Algorithm: sha1WithRSAEncryption c7:61:45:a8:8a:71:b9:be:34:e9:21:7b:21:cd:56:13:98:d5: @@ -368,7 +368,7 @@ Certificate Ingredients: 5d:88:64:d0:c8:f8:5d:54:51 Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 63:76:17:7c:96:f0:53:a5:5d:01:1c:53:ce:29:c2:7e:75:ac: @@ -427,7 +427,7 @@ Certificate Ingredients: ee:4a:fd:6d:de:fe:26:a5:3b Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL Client, S/MIME Signature Algorithm: md5WithRSAEncryption 6c:3d:99:c3:05:e2:1d:ca:e5:2d:aa:68:85:8b:40:31:20:66: @@ -484,11 +484,11 @@ Certificate Ingredients: 94:40:64:78:83:a1:cc:39:89 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE, pathlen:5 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 2C:87:59:1F:8B:13:80:B2:F9:86:9D:3E:12:7E:58:96 Signature Algorithm: md5WithRSAEncryption 0f:fe:73:b5:07:88:6f:a0:0b:89:ea:ca:50:1f:94:de:94:2b: @@ -548,23 +548,23 @@ Certificate Ingredients: 13:74:76:36:b5:7a:b4:2d:71 Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Digital Signature Trust Co./OU=DSTCA E1/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Dec 10 18:10:23 1998 GMT, Not After: Dec 10 18:10:23 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:6A:79:7E:91:69:46:18:13:0A:02:77:A5:59:5B:60:98:25:0E:A2:F8 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 6A:79:7E:91:69:46:18:13:0A:02:77:A5:59:5B:60:98:25:0E:A2:F8 - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: sha1WithRSAEncryption @@ -703,23 +703,23 @@ Certificate Ingredients: 0c:9d:e7:91:5b:80:cd:94:9d Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Digital Signature Trust Co./OU=DSTCA E2/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Dec 9 19:17:26 1998 GMT, Not After: Dec 9 19:17:26 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:1E:82:4D:28:65:80:3C:C9:41:6E:AC:35:2E:5A:CB:DE:EE:F8:39:5B - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 1E:82:4D:28:65:80:3C:C9:41:6E:AC:35:2E:5A:CB:DE:EE:F8:39:5B - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: sha1WithRSAEncryption @@ -859,23 +859,23 @@ Certificate Ingredients: c6:ec:3f:be:35:9c:3d:22:ef Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Digital Signature Trust Co./OU=DST-Entrust GTI CA/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Dec 9 00:02:24 1998 GMT, Not After: Dec 9 00:02:24 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:93:9A:44:CA:D0:78:53:80:29:49:04:DF:C7:AF:33:3F:99:75:5F:AE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 93:9A:44:CA:D0:78:53:80:29:49:04:DF:C7:AF:33:3F:99:75:5F:AE - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: sha1WithRSAEncryption @@ -952,14 +952,14 @@ Certificate Ingredients: 07:e1 Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:55:E4:81:D1:11:80:BE:D8:89:B9:08:A3:31:F9:A1:24:09:16:B9:70 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 55:E4:81:D1:11:80:BE:D8:89:B9:08:A3:31:F9:A1:24:09:16:B9:70 - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0...V5.0:4.0.... Signature Algorithm: sha1WithRSAEncryption 59:47:ac:21:84:8a:17:c9:9c:89:53:1e:ba:80:85:1a:c6:3c: @@ -1036,24 +1036,24 @@ Certificate Ingredients: 8c:e6:02:a4:e6:4f:5e:f7:8b Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Entrust.net/OU=www.entrust.net/Client_CA_Info/CPS incorp. by ref. limits liab./OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Client Certification Authority/CN=CRL1 URI:http://www.entrust.net/CRL/Client1.crl - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Oct 12 19:24:30 1999 GMT, Not After: Oct 12 19:24:30 2019 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:C4:FB:9C:29:7B:97:CD:4C:96:FC:EE:5B:B3:CA:99:74:8B:95:EA:4C - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C4:FB:9C:29:7B:97:CD:4C:96:FC:EE:5B:B3:CA:99:74:8B:95:EA:4C - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: md5WithRSAEncryption @@ -1123,24 +1123,24 @@ Certificate Ingredients: b1:16:19:61:b9:54:b6:e6:43 Exponent: 3 (0x3) X509v3 extensions: - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority/CN=CRL1 URI:http://www.entrust.net/CRL/net1.crl - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: May 25 16:09:40 1999 GMT, Not After: May 25 16:09:40 2019 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0 ..V4.0.... Signature Algorithm: sha1WithRSAEncryption @@ -1201,21 +1201,21 @@ Certificate Ingredients: d2:d8:ba:9a:ff:be:10:60:5b Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Equifax/OU=Equifax Premium Certificate Authority/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not After: Aug 24 22:54:23 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:15:EE:B2:28:59:AB:6E:E5:F8:CF:8B:81:F4:24:E1:AE:3F:75:1B:98 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 15:EE:B2:28:59:AB:6E:E5:F8:CF:8B:81:F4:24:E1:AE:3F:75:1B:98 - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0...V3.0c.... Signature Algorithm: sha1WithRSAEncryption bd:0b:9c:27:a9:03:db:28:dc:98:a9:4b:d0:d1:8e:a7:a8:1a: @@ -1275,21 +1275,21 @@ Certificate Ingredients: 3a:88:e7:bf:14:fd:e0:c7:b9 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: DirName:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority/CN=CRL1 - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not After: Aug 22 16:41:51 2018 GMT - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:48:E6:68:F9:2B:D2:B2:95:D7:47:D8:23:20:10:4F:33:98:90:9F:D4 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 48:E6:68:F9:2B:D2:B2:95:D7:47:D8:23:20:10:4F:33:98:90:9F:D4 - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0...V3.0c.... Signature Algorithm: sha1WithRSAEncryption 58:ce:29:ea:fc:f7:de:b5:ce:02:b9:17:b5:85:d1:b9:e3:e0: @@ -1702,10 +1702,10 @@ Certificate Ingredients: CA:TRUE, pathlen:5 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: 1.2.840.113763.1.2.1.3 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 76:0A:49:21:38:4C:9F:DE:F8:C4:49:C7:71:71:91:9D Signature Algorithm: sha1WithRSAEncryption 41:3a:d4:18:5b:da:b8:de:21:1c:e1:8e:09:e5:f1:68:34:ff: @@ -1838,9 +1838,9 @@ Certificate Ingredients: X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 43:24:8D:70:15:08:62:55:9C:4F:0C:40:17:5D:86:5E:0F:A2:4C:FB - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B X509v3 Basic Constraints: critical @@ -1925,9 +1925,9 @@ Certificate Ingredients: X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: FC:E0:66:F6:5A:35:99:EB:40:1E:D2:B8:1E:43:BC:98:8E:1F:8A:C3 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B X509v3 Basic Constraints: critical @@ -2012,9 +2012,9 @@ Certificate Ingredients: X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7C:E7:B2:B1:2C:DE:B1:A7:6B:E9:76:0C:E1:A3:FD:4E:6C:C7:B9:F6 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B X509v3 Basic Constraints: critical @@ -2099,9 +2099,9 @@ Certificate Ingredients: X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: CC:36:CC:17:B4:45:91:2F:ED:CF:3B:30:48:77:FB:B5:14:99:BE:E3 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B X509v3 Basic Constraints: critical @@ -2185,7 +2185,7 @@ Certificate Ingredients: X509v3 extensions: X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B X509v3 Basic Constraints: critical CA:TRUE @@ -2339,17 +2339,17 @@ Certificate Ingredients: 39:d7:e5:5f:fa:e4:7e:cc:a3 Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Revocation Url: + Netscape Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: + Netscape Renewal Url: https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: + Netscape CA Policy Url: http://www.trustcenter.de/guidelines/index.html - Netscape Comment: + Netscape Comment: TC TrustCenter Class 0 CA - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 4d:07:7f:5f:09:30:19:92:aa:05:47:7a:94:75:54:2a:ae:cf: @@ -2415,17 +2415,17 @@ Certificate Ingredients: 44:c8:a3:61:ca:1b:a0:36:1f Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Revocation Url: + Netscape Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: + Netscape Renewal Url: https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: + Netscape CA Policy Url: http://www.trustcenter.de/guidelines/index.html - Netscape Comment: + Netscape Comment: TC TrustCenter Class 1 CA - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 05:42:52:26:a4:0c:27:01:44:ac:5c:25:28:c2:44:42:54:08: @@ -2491,17 +2491,17 @@ Certificate Ingredients: 9c:fb:fc:57:9b:57:5c:4f:0d Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Revocation Url: + Netscape Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: + Netscape Renewal Url: https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: + Netscape CA Policy Url: http://www.trustcenter.de/guidelines/index.html - Netscape Comment: + Netscape Comment: TC TrustCenter Class 2 CA - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 89:1b:f4:ef:e9:38:e2:6c:0c:f6:cd:6f:49:ce:29:cc:fb:a6: @@ -2567,17 +2567,17 @@ Certificate Ingredients: ea:64:cf:d2:8e:7a:50:77:77 Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Revocation Url: + Netscape Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: + Netscape Renewal Url: https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: + Netscape CA Policy Url: http://www.trustcenter.de/guidelines/index.html - Netscape Comment: + Netscape Comment: TC TrustCenter Class 3 CA - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 84:86:50:62:79:a0:27:e1:25:ba:09:b1:34:0f:13:09:ed:2d: @@ -2643,17 +2643,17 @@ Certificate Ingredients: 35:1d:29:4c:51:f3:f2:6c:55 Exponent: 65537 (0x10001) X509v3 extensions: - Netscape Revocation Url: + Netscape Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://www.trustcenter.de/cgi-bin/check-rev.cgi? - Netscape Renewal Url: + Netscape Renewal Url: https://www.trustcenter.de/cgi-bin/Renew.cgi? - Netscape CA Policy Url: + Netscape CA Policy Url: http://www.trustcenter.de/guidelines/index.html - Netscape Comment: + Netscape Comment: TC TrustCenter Class 4 CA - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: md5WithRSAEncryption 94:68:14:1b:25:9e:29:99:b1:b2:23:d2:44:b3:95:9f:d1:9e: @@ -4543,29 +4543,29 @@ Certificate: 44:e4:e9 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: 2.16.840.1.113733.1.7.1.1 CPS: http://trust.web.de/Hilfe/Policy/ - Netscape Comment: + Netscape Comment: TrustCenter von WEB.DE - Root-Zertifikat Die Nutzung dieses Zertifikates wird von den Allgemeinen Geschäftsbedingungen (AGB) / Zertifizierungsrichtlinien des WEB.DE TrustCenters geregelt. Die AGBs und Zertifizierungsrichtlinien sind unter http://trust.web.de/Hilfe/ einsehbar. - Netscape CA Policy Url: + Netscape CA Policy Url: /Hilfe/AGB/ - Netscape Renewal Url: + Netscape Renewal Url: /rn/?s= - Netscape Revocation Url: + Netscape Revocation Url: /rv/?s= - Netscape Base Url: + Netscape Base Url: https://trust.web.de - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA - Netscape CA Revocation Url: + Netscape CA Revocation Url: https://trust.web.de/rvCA/?s= Signature Algorithm: md5WithRSAEncryption 2d:3d:17:6d:14:09:03:ea:4c:ad:45:13:e2:d9:b5:9c:29:cf: diff --git a/contrib/gpg.rc b/contrib/gpg.rc index 2ef0ae2cf..5c4dd2727 100644 --- a/contrib/gpg.rc +++ b/contrib/gpg.rc @@ -1,8 +1,8 @@ # -*-muttrc-*- # # Command formats for gpg. -# -# This version uses gpg-2comp from +# +# This version uses gpg-2comp from # http://70t.de/download/gpg-2comp.tar.gz # # $Id$ diff --git a/contrib/hcache-bench/README.md b/contrib/hcache-bench/README.md index 48c25aded..a586384b7 100644 --- a/contrib/hcache-bench/README.md +++ b/contrib/hcache-bench/README.md @@ -2,7 +2,7 @@ ## Introduction -The shell script and the configuration file in this directory can be used to benchmark the NeoMutt hcache backends. +The shell script and the configuration file in this directory can be used to benchmark the NeoMutt hcache backends. ## Preparation diff --git a/contrib/hcache-bench/neomutt-hcache-bench.sh b/contrib/hcache-bench/neomutt-hcache-bench.sh index 9e4ac3f67..7e6d8262f 100755 --- a/contrib/hcache-bench/neomutt-hcache-bench.sh +++ b/contrib/hcache-bench/neomutt-hcache-bench.sh @@ -1,10 +1,10 @@ #!/bin/sh # # Copyright 2017 Pietro Cerutti -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright notice, diff --git a/contrib/iconv/make.sh b/contrib/iconv/make.sh index 777d00260..d43550771 100755 --- a/contrib/iconv/make.sh +++ b/contrib/iconv/make.sh @@ -10,7 +10,7 @@ LIBICONV="$1" test -d $LIBICONV/libcharset/tools || { - echo "Sorry, I can't find libiconv's source!" >&2 ; + echo "Sorry, I can't find libiconv's source!" >&2 ; exit 1 ; } diff --git a/contrib/keybase/install.sh b/contrib/keybase/install.sh index 5466d0415..854d26b81 100644 --- a/contrib/keybase/install.sh +++ b/contrib/keybase/install.sh @@ -52,7 +52,7 @@ elif [ "$shellInput" = 'k' ]; then echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> "$HOME/.kshrc" elif [ "$shellInput" = 'z' ]; then echo 'export PATH="$PATH:~/.mutt/keybaseMutt/scripts"' >> "$HOME/.zshrc" -else +else echo "If you use something another shell, you'll need to add the path manually." fi diff --git a/contrib/language.txt b/contrib/language.txt index a6b25255e..e6aee7bcc 100644 --- a/contrib/language.txt +++ b/contrib/language.txt @@ -1227,7 +1227,7 @@ soll ein 'absolut vertrauensw sich nicht im privaten Schlüsselbund. Soll ich diesen Schlüssel trotzdem\n\ als 'absolut vertrauenswürdigen Einführer' behandeln? (j/N) " es: "\nLa clave del usuario \"%s\"\n\ -está designada como referencia \"fundamentalmente fiable\", pero +está designada como referencia \"fundamentalmente fiable\", pero la clave no aparece en el anillo de claves secretas.\n\ ¿Se utiliza como referencia fundamentalmente fiable (s/N)? " fr: "\nLa clef de l'utilisateur '%s' \n\ diff --git a/contrib/patch.slang-1.2.2.keypad.1 b/contrib/patch.slang-1.2.2.keypad.1 index 93df4d72e..4f51cd6cb 100644 --- a/contrib/patch.slang-1.2.2.keypad.1 +++ b/contrib/patch.slang-1.2.2.keypad.1 @@ -17,7 +17,7 @@ diff -ur slang.old/src/slkeymap.c slang/src/slkeymap.c --- slang.old/src/slkeymap.c Fri Apr 24 09:16:47 1998 +++ slang/src/slkeymap.c Sat Jul 4 07:41:42 1998 @@ -343,6 +343,8 @@ - + SLang_Key_Type *SLang_do_key(SLKeyMap_List_Type *kml, int (*getkey)(void)) { + unsigned char SLang_Undo_Buffer [SL_MAX_INPUT_BUFFER_LEN]; @@ -27,14 +27,14 @@ diff -ur slang.old/src/slkeymap.c slang/src/slkeymap.c unsigned char input_ch; @@ -356,6 +358,7 @@ return NULL; - + input_ch = (unsigned char) SLang_Last_Key_Char; + SLang_Undo_Buffer [SLang_Undo_Len++] = input_ch; - + key = (SLang_Key_Type *) &((kml->keymap)[input_ch]); - + @@ -372,7 +375,11 @@ - + key = kml->keymap + input_ch; if (key->type == 0) + { @@ -43,7 +43,7 @@ diff -ur slang.old/src/slkeymap.c slang/src/slkeymap.c return NULL; + } } - + /* It appears to be a prefix character in a key sequence. */ @@ -385,6 +392,7 @@ { @@ -51,17 +51,17 @@ diff -ur slang.old/src/slkeymap.c slang/src/slkeymap.c SLang_Last_Key_Char = (*getkey)(); + SLang_Undo_Buffer [SLang_Undo_Len++] = (unsigned char) SLang_Last_Key_Char; SLang_Key_TimeOut_Flag = 0; - + len++; @@ -458,6 +466,8 @@ kmax = next; } - + + if (getkey == (int (*)(void)) SLang_getkey) + SLang_ungetkey_string (SLang_Undo_Buffer, SLang_Undo_Len); return NULL; } - + diff -ur slang.old/src/slkeypad.c slang/src/slkeypad.c --- slang.old/src/slkeypad.c Fri Apr 24 09:16:47 1998 +++ slang/src/slkeypad.c Sat Jul 4 07:30:31 1998 @@ -73,4 +73,4 @@ diff -ur slang.old/src/slkeypad.c slang/src/slkeypad.c + /* SLang_flush_input (); */ return SL_KEY_ERR; } - + diff --git a/contrib/pgp5.rc b/contrib/pgp5.rc index d2e578fb7..627e57979 100644 --- a/contrib/pgp5.rc +++ b/contrib/pgp5.rc @@ -36,7 +36,7 @@ set pgp_export_command="pgpk -xa +language=mutt --OutputInformationFD=1 %r" set pgp_verify_key_command="pgpk -c +batchmode +language=mutt --OutputInformationFD=1 %r" # read in the public key ring -set pgp_list_pubring_command="pgpring -5 %r" +set pgp_list_pubring_command="pgpring -5 %r" # read in the secret key ring set pgp_list_secring_command="pgpring -5 -s %r" diff --git a/contrib/sample.muttrc b/contrib/sample.muttrc index 07dbe1797..34e00cb9f 100644 --- a/contrib/sample.muttrc +++ b/contrib/sample.muttrc @@ -168,7 +168,7 @@ mono quoted bold # generic generic keymap for all of the above # editor line editor # pager text viewer -# +# bind generic "\e<" first-entry # emacs-like bindings for moving to top/bottom bind generic \e> last-entry diff --git a/contrib/sample.muttrc-tlr b/contrib/sample.muttrc-tlr index 0072e3a26..43b9b3b22 100644 --- a/contrib/sample.muttrc-tlr +++ b/contrib/sample.muttrc-tlr @@ -9,7 +9,7 @@ # using it won't make you send messages with my name in the header. # # Things to change: You probably want to change the "priv.rc" source -# command in the end of this file. Also, it's likely you want to have +# command in the end of this file. Also, it's likely you want to have # a look at the the $editor and $tmpdir variables. # @@ -19,7 +19,7 @@ # auto_view application/ms-tnef text/x-vcard # auto_view application/x-chess application/x-lotus-notes -# auto_view text/html application/x-gzip application/x-gunzip +# auto_view text/html application/x-gzip application/x-gunzip # auto_view application/rtf application/x-rath # auto_view application/msword @@ -141,7 +141,7 @@ macro pager ";" "" # emulate the old POP-feature bindings -macro index G "!fetchmail\n" +macro index G "!fetchmail\n" macro pager G "!fetchmail\n" # razor-report: Report spam. @@ -203,7 +203,7 @@ unset confirmappend # Don't ask me about appending to files set delete=yes # Don't ask me whether or not I meant to delete messages # set display_filter="tr '\240\204\223\226' ' \"\"-'" # fix some funny characters set edit_hdrs # I want to edit the headers. -set editor="/usr/bin/jed %s -f 'mail_mode();'" +set editor="/usr/bin/jed %s -f 'mail_mode();'" # Invoke jed with mail_mode. This may # or may not work for you. set noenvelope_from # set messages' envelope-from header. @@ -242,7 +242,7 @@ set record="+archive/now" # Put copies of most outgoing messages to ~/Mail/ar set reply_to=ask-yes # Ask me whether I want to honor users' reply-to headers. set reverse_alias # Use aliases to display real names on the index. set save_name # Save copies by name. Together with $record and $save_name, - # this means that when a folder exists, copies of outgoing + # this means that when a folder exists, copies of outgoing # messages are written to ~/Mail/, otherwise they go to # ~/Mail/archive/now set signature=~/.signature # Silly signature diff --git a/contrib/smime_keys_test.pl b/contrib/smime_keys_test.pl index 79c555cc9..6ef798008 100644 --- a/contrib/smime_keys_test.pl +++ b/contrib/smime_keys_test.pl @@ -42,8 +42,8 @@ close OUT; open OUT, '>demoCA/index.txt' or die; close OUT; -# make the CA -run 'openssl req -new -x509 -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 7300 -nodes', +# make the CA +run 'openssl req -new -x509 -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 7300 -nodes', "\n\nx\n\nx\nx\n\n"; # trust it @@ -102,7 +102,7 @@ unlink 'list' or die; run "openssl smime -sign -signer certificates/$keyid -inkey user.key -in /etc/passwd -certfile certificates/37adefc3.0 > signed"; unlink 'user.key' or die; -# verify it +# verify it run 'openssl smime -verify -out /dev/null -in signed -CAfile ca-bundle.crt'; unlink 'signed' or die; @@ -122,7 +122,7 @@ rmdir $tmpdir or die; sub run ($;$) { my $cmd = shift or die; my $input = shift; - + print "\n\nRunning [$cmd]\n"; my $exp = Expect->spawn ($cmd); diff --git a/copy.c b/copy.c index 745474f71..73b689dbc 100644 --- a/copy.c +++ b/copy.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2002,2014 Michael R. Elkins - * + * * 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" @@ -170,7 +170,7 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, /* Do we have anything pending? */ if (this_one) { - if (flags & CH_DECODE) + if (flags & CH_DECODE) { if (!address_header_decode (&this_one)) rfc2047_decode (&this_one); @@ -179,7 +179,7 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, if (!headers[x]) headers[x] = this_one; - else + else { int hlen = mutt_strlen (headers[x]); @@ -265,16 +265,16 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, /* Do we have anything pending? -- XXX, same code as in above in the loop. */ if (this_one) { - if (flags & CH_DECODE) + if (flags & CH_DECODE) { if (!address_header_decode (&this_one)) rfc2047_decode (&this_one); this_one_len = mutt_strlen (this_one); } - + if (!headers[x]) headers[x] = this_one; - else + else { int hlen = mutt_strlen (headers[x]); @@ -299,10 +299,10 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, /* We couldn't do the prefixing when reading because RFC 2047 * decoding may have concatenated lines. */ - + if (flags & (CH_DECODE|CH_PREFIX)) { - if (mutt_write_one_header (out, 0, headers[x], + if (mutt_write_one_header (out, 0, headers[x], flags & CH_PREFIX ? prefix : 0, mutt_window_wrap_cols (MuttIndexWindow, Wrap), flags) == -1) { @@ -311,7 +311,7 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, } } else - { + { if (fputs (headers[x], out) == EOF) { error = true; @@ -473,7 +473,7 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) if (ferror (out) || feof (out)) return -1; - + return 0; } @@ -510,7 +510,7 @@ static int count_delete_lines (FILE *fp, BODY *b, LOFF_T *length, size_t datelen } /* make a copy of a message - * + * * fpout where to write output * fpin where to get input * hdr header of message being copied @@ -523,7 +523,7 @@ static int count_delete_lines (FILE *fp, BODY *b, LOFF_T *length, size_t datelen * MUTT_CM_PRINTING printing the message * MUTT_CM_UPDATE update structures in memory after syncing * MUTT_CM_DECODE_PGP used for decoding PGP messages - * MUTT_CM_CHARCONV perform character set conversion + * MUTT_CM_CHARCONV perform character set conversion * chflags flags to mutt_copy_header() */ @@ -599,7 +599,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, } #endif - /* Update original message if we are sync'ing a mailfolder */ + /* Update original message if we are sync'ing a mailfolder */ if (flags & MUTT_CM_UPDATE) { hdr->attach_del = 0; @@ -647,7 +647,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, s.flags |= MUTT_CHARCONV; if (flags & MUTT_CM_REPLYING) s.flags |= MUTT_REPLYING; - + if (WithCrypto && flags & MUTT_CM_VERIFY) s.flags |= MUTT_VERIFY; @@ -702,9 +702,9 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, { int c; size_t bytes = body->length; - + fputs(prefix, fpout); - + while((c = fgetc(fpin)) != EOF && bytes--) { fputc(c, fpout); @@ -712,13 +712,13 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, { fputs(prefix, fpout); } - } + } } else if (mutt_copy_bytes (fpin, fpout, body->length) == -1) return -1; } - if ((flags & MUTT_CM_UPDATE) && (flags & MUTT_CM_NOHEADER) == 0 + if ((flags & MUTT_CM_UPDATE) && (flags & MUTT_CM_NOHEADER) == 0 && new_offset != -1) { body->offset = new_offset; @@ -739,7 +739,7 @@ mutt_copy_message (FILE *fpout, CONTEXT *src, HEADER *hdr, int flags, if ((msg = mx_open_message (src, hdr->msgno)) == NULL) return -1; - if ((r = _mutt_copy_message (fpout, msg->fp, hdr, hdr->content, flags, chflags)) == 0 + if ((r = _mutt_copy_message (fpout, msg->fp, hdr, hdr->content, flags, chflags)) == 0 && (ferror (fpout) || feof (fpout))) { mutt_debug (1, "_mutt_copy_message failed to detect EOF!\n"); @@ -854,13 +854,13 @@ static int copy_delete_attach (BODY *b, FILE *fpin, FILE *fpout, char *date) return 0; } -/* +/* * This function is the equivalent of mutt_write_address_list(), * but writes to a buffer instead of writing to a stream. * mutt_write_address_list could be re-used if we wouldn't store - * all the decoded headers in a huge array, first. + * all the decoded headers in a huge array, first. * - * XXX - fix that. + * XXX - fix that. */ static void format_address_header (char **h, ADDRESS *a) @@ -883,8 +883,8 @@ static void format_address_header (char **h, ADDRESS *a) *buf = *cbuf = *c2buf = '\0'; l = rfc822_write_address (buf, sizeof (buf), a, 0); a->next = tmp; - - if (count && linelen + l > 74) + + if (count && linelen + l > 74) { strcpy (cbuf, "\n\t"); /* __STRCPY_CHECKED__ */ linelen = l + 8; @@ -917,7 +917,7 @@ static void format_address_header (char **h, ADDRESS *a) strcat (p + plen, c2buf); /* __STRCAT_CHECKED__ */ plen += c2buflen; } - + /* Space for this was allocated in the beginning of this function. */ strcat (p + plen, "\n"); /* __STRCAT_CHECKED__ */ } @@ -932,7 +932,7 @@ static int address_header_decode (char **h) switch (tolower ((unsigned char) *s)) { - case 'r': + case 'r': { if (ascii_strncasecmp (s, "return-path:", 12) == 0) { @@ -947,10 +947,10 @@ static int address_header_decode (char **h) } return 0; } - case 'f': + case 'f': { - if (ascii_strncasecmp (s, "from:", 5)) - return 0; + if (ascii_strncasecmp (s, "from:", 5)) + return 0; l = 5; break; } @@ -960,7 +960,7 @@ static int address_header_decode (char **h) return 0; l = 3; break; - + } case 'b': { @@ -990,12 +990,12 @@ static int address_header_decode (char **h) l = 17; break; } - default: return 0; + default: return 0; } if ((a = rfc822_parse_adrlist (a, s + l)) == NULL) return 0; - + mutt_addrlist_to_local (a); rfc2047_decode_adrlist (a); for (cur = a; cur; cur = cur->next) diff --git a/copy.h b/copy.h index b47c7fbd0..5c7c1ae87 100644 --- a/copy.h +++ b/copy.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ /* flags to _mutt_copy_message */ #define MUTT_CM_NOHEADER 1 /* don't copy the message header */ diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 9605233dc..1db3bb9b8 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -10,12 +10,12 @@ * 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. @@ -277,7 +277,7 @@ static char crypt_flags (int flags) return 'd'; else if (flags & KEYFLAG_CRITICAL) return 'c'; - else + else return ' '; } @@ -362,21 +362,21 @@ static int crypt_id_matches_addr (ADDRESS *addr, ADDRESS *u_addr, crypt_key_t *key) { int rv = 0; - + if (crypt_id_is_valid (key)) rv |= CRYPT_KV_VALID; if (crypt_id_is_strong (key)) rv |= CRYPT_KV_STRONGID; - + if (addr->mailbox && u_addr->mailbox && mutt_strcasecmp (addr->mailbox, u_addr->mailbox) == 0) rv |= CRYPT_KV_ADDR; - + if (addr->personal && u_addr->personal && mutt_strcasecmp (addr->personal, u_addr->personal) == 0) rv |= CRYPT_KV_STRING; - + return rv; } @@ -423,7 +423,7 @@ static gpgme_data_t create_gpgme_data (void) gpgme_data_t data; err = gpgme_data_new (&data); - if (err) + if (err) { mutt_error (_("error creating gpgme data object: %s\n"), gpgme_strerror (err)); @@ -442,7 +442,7 @@ static gpgme_data_t body_to_data_object (BODY *a, int convert) FILE *fptmp; int err = 0; gpgme_data_t data; - + mutt_mktemp (tempfile, sizeof (tempfile)); fptmp = safe_fopen (tempfile, "w+"); if (!fptmp) @@ -466,14 +466,14 @@ static gpgme_data_t body_to_data_object (BODY *a, int convert) { if (c == '\r') hadcr = 1; - else + else { if (c == '\n' && !hadcr) { buf[0] = '\r'; gpgme_data_write (data, buf, 1); } - + hadcr = 0; } /* FIXME: This is quite suboptimal */ @@ -489,7 +489,7 @@ static gpgme_data_t body_to_data_object (BODY *a, int convert) err = gpgme_data_new_from_file (&data, tempfile, 1); } unlink (tempfile); - if (err) + if (err) { mutt_error (_("error allocating data object: %s\n"), gpgme_strerror (err)); return NULL; @@ -505,9 +505,9 @@ static gpgme_data_t file_to_data_object (FILE *fp, long offset, long length) { int err = 0; gpgme_data_t data; - + err = gpgme_data_new_from_filepart (&data, NULL, fp, offset, length); - if (err) + if (err) { mutt_error (_("error allocating data object: %s\n"), gpgme_strerror (err)); return NULL; @@ -664,12 +664,12 @@ static gpgme_key_t *create_recipient_set (const char *keylist, buf[i] = 0; if (*buf) { - if (i>1 && buf[i-1] == '!') + if (i>1 && buf[i-1] == '!') { /* The user selected to override the validity of that key. */ buf[i-1] = 0; - + err = gpgme_get_key (context, buf, &key, 0); if (! err) key->uids->validity = GPGME_VALIDITY_FULL; @@ -697,7 +697,7 @@ static gpgme_key_t *create_recipient_set (const char *keylist, /* NULL terminate. */ safe_realloc (&rset, sizeof (*rset) * (rset_n + 1)); rset[rset_n++] = NULL; - + if (context) gpgme_release (context); @@ -784,7 +784,7 @@ static char *encrypt_gpgme_object (gpgme_data_t plaintext, gpgme_key_t *rset, char *outfile; ctx = create_gpgme_context (use_smime); - if (!use_smime) + if (!use_smime) gpgme_set_armor (ctx, 1); ciphertext = create_gpgme_data (); @@ -880,7 +880,7 @@ static void print_time(time_t t, STATE *s) state_puts (p, s); } -/* +/* * Implementation of `sign_message'. */ @@ -988,7 +988,7 @@ static BODY *sign_message (BODY *a, int use_smime) { t->subtype = safe_strdup ("pkcs7-signature"); mutt_set_parameter ("name", "smime.p7s", &t->parameter); - t->encoding = ENCBASE64; + t->encoding = ENCBASE64; t->use_disp = 1; t->disposition = DISPATTACH; t->d_filename = safe_strdup ("smime.p7s"); @@ -1030,11 +1030,11 @@ BODY *pgp_gpgme_encrypt_message (BODY *a, char *keylist, int sign) BODY *t; gpgme_key_t *rset = NULL; gpgme_data_t plaintext; - + rset = create_recipient_set (keylist, GPGME_PROTOCOL_OpenPGP); if (!rset) return NULL; - + if (sign) convert_to_7bit (a); plaintext = body_to_data_object (a, 0); @@ -1043,7 +1043,7 @@ BODY *pgp_gpgme_encrypt_message (BODY *a, char *keylist, int sign) free_recipient_set (&rset); return NULL; } - + outfile = encrypt_gpgme_object (plaintext, rset, 0, sign); gpgme_data_release (plaintext); free_recipient_set (&rset); @@ -1059,7 +1059,7 @@ BODY *pgp_gpgme_encrypt_message (BODY *a, char *keylist, int sign) mutt_generate_boundary(&t->parameter); mutt_set_parameter("protocol", "application/pgp-encrypted", &t->parameter); - + t->parts = mutt_new_body (); t->parts->type = TYPEAPPLICATION; t->parts->subtype = safe_strdup ("pgp-encrypted"); @@ -1110,7 +1110,7 @@ BODY *smime_gpgme_build_smime_entity (BODY *a, char *keylist) outfile = encrypt_gpgme_object (plaintext, rset, 1, 0); gpgme_data_release (plaintext); free_recipient_set (&rset); - if (!outfile) + if (!outfile) return NULL; t = mutt_new_body (); @@ -1126,12 +1126,12 @@ BODY *smime_gpgme_build_smime_entity (BODY *a, char *keylist) t->unlink = 1; /*delete after sending the message */ t->parts=0; t->next=0; - + return t; } -/* +/* * Implementation of `verify_one'. */ @@ -1170,13 +1170,13 @@ static int show_sig_summary (unsigned long sum, gpgme_verify_result_t result; gpgme_signature_t sig; unsigned int i; - + result = gpgme_op_verify_result (ctx); for (sig = result->signatures, i = 0; sig && (i < idx); sig = sig->next, i++) ; - + state_puts (_("Warning: The signature expired at: "), s); print_time (sig ? sig->exp_timestamp : 0, s); state_puts ("\n", s); @@ -1405,7 +1405,7 @@ static void print_smime_keyinfo (const char* msg, gpgme_signature_t sig, /* Show information about one signature. This function is called with the context CTX of a successful verification operation and the enumerator IDX which should start at 0 and increment for each - call/signature. + call/signature. Return values are: 0 for normal procession, 1 for a bad signature, 2 for a signature with a warning or -1 for no more signature. */ @@ -1438,7 +1438,7 @@ static int show_one_sig_status (gpgme_ctx_t ctx, int idx, STATE *s) gpgme_key_unref (signature_key); signature_key = NULL; } - + fpr = sig->fpr; sum = sig->summary; @@ -1542,7 +1542,7 @@ static int verify_one (BODY *sigbdy, STATE *s, gpgme_data_set_encoding (signature, GPGME_DATA_ENCODING_BASE64); err = gpgme_data_new_from_file (&message, tempfile, 1); - if (err) + if (err) { gpgme_data_release (signature); mutt_error (_("error allocating data object: %s\n"), gpgme_strerror (err)); @@ -1563,8 +1563,8 @@ static int verify_one (BODY *sigbdy, STATE *s, if (err) { char buf[200]; - - snprintf (buf, sizeof(buf)-1, + + snprintf (buf, sizeof(buf)-1, _("Error: verification failed: %s\n"), gpgme_strerror (err)); state_puts (buf, s); @@ -1648,10 +1648,10 @@ static int verify_one (BODY *sigbdy, STATE *s, } gpgme_release (ctx); - + state_attach_puts (_("[-- End signature information --]\n\n"), s); mutt_debug (1, "verify_one: returning %d.\n", badsig); - + return badsig? 1: anywarn? 2 : 0; } @@ -1742,8 +1742,8 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime, if ((s->flags & MUTT_DISPLAY)) { char buf[200]; - - snprintf (buf, sizeof(buf)-1, + + snprintf (buf, sizeof(buf)-1, _("[-- Error: decryption failed: %s --]\n\n"), gpgme_strerror (err)); state_attach_puts (buf, s); @@ -1769,7 +1769,7 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime, { int res, idx; int anybad = 0; - + if (maybe_signed) a->is_signed_data = 1; if(r_is_signed) @@ -1787,7 +1787,7 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime, } if (!anybad && idx && r_is_signed && *r_is_signed) *r_is_signed = anywarn? 2:1; /* Good signature. */ - + if ((s->flags & MUTT_DISPLAY)) state_attach_puts (_("[-- End signature " "information --]\n\n"), s); @@ -1804,7 +1804,7 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime, */ fstat (fileno (fpout), &info); tattach->length = info.st_size - tattach->offset; - + tattach->warnsig = anywarn; /* See if we need to recurse on this MIME part. */ @@ -1828,7 +1828,7 @@ int pgp_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) size_t saved_length; FILE *decoded_fp = NULL; int rv = 0; - + first_part->goodsig = 0; first_part->warnsig = 0; @@ -1841,7 +1841,7 @@ int pgp_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) } else return -1; - + memset (&s, 0, sizeof (s)); s.fpin = fpin; @@ -1917,7 +1917,7 @@ int smime_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) if (b->parts) return -1; - + /* Decode the body - we need to pass binary CMS to the backend. The backend allows for Base64 encoded data but it does not allow for QP which I have seen in some messages. So better @@ -1927,7 +1927,7 @@ int smime_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) saved_b_length = b->length; memset (&s, 0, sizeof (s)); s.fpin = fpin; - fseeko (s.fpin, b->offset, 0); + fseeko (s.fpin, b->offset, 0); mutt_mktemp (tempfile, sizeof (tempfile)); if (!(tmpfp = safe_fopen (tempfile, "w+"))) { @@ -1981,7 +1981,7 @@ int smime_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) saved_b_length = bb->length; memset (&s, 0, sizeof (s)); s.fpin = *fpout; - fseeko (s.fpin, bb->offset, 0); + fseeko (s.fpin, bb->offset, 0); mutt_mktemp (tempfile, sizeof (tempfile)); if (!(tmpfp = safe_fopen (tempfile, "w+"))) { @@ -1996,7 +1996,7 @@ int smime_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) bb->length = ftello (s.fpout); bb->offset = 0; rewind (tmpfp); - safe_fclose (fpout); + safe_fclose (fpout); memset (&s, 0, sizeof (s)); s.fpin = tmpfp; @@ -2047,7 +2047,7 @@ static int pgp_gpgme_extract_keys (gpgme_data_t keydata, FILE** fp, int dryrun) mutt_debug (1, "Error creating GPGME context\n"); return rc; } - + if (dryrun) { snprintf (tmpdir, sizeof(tmpdir), "%s/mutt-gpgme-XXXXXX", Tempdir); @@ -2163,7 +2163,7 @@ static int line_compare(const char *a, size_t n, const char *b) #define PUBLIC_KEY_BLOCK(_y) _LINE_COMPARE("PUBLIC KEY BLOCK-----", _y) #define BEGIN_PGP_SIGNATURE(_y) _LINE_COMPARE("-----BEGIN PGP SIGNATURE-----", _y) -/* +/* * Implementation of `pgp_check_traditional'. */ @@ -2172,10 +2172,10 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) char tempfile[_POSIX_PATH_MAX]; char buf[HUGE_STRING]; FILE *tfp; - + short sgn = 0; short enc = 0; - + if (b->type != TYPETEXT) return 0; @@ -2188,13 +2188,13 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) unlink (tempfile); return 0; } - + if ((tfp = fopen (tempfile, "r")) == NULL) { unlink (tempfile); return 0; } - + while (fgets (buf, sizeof (buf), tfp)) { if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15)) @@ -2218,11 +2218,11 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) return 0; /* fix the content type */ - + mutt_set_parameter ("format", "fixed", &b->parameter); mutt_set_parameter ("x-action", enc ? "pgp-encrypted" : "pgp-signed", &b->parameter); - + return 1; } @@ -2276,18 +2276,18 @@ void pgp_gpgme_invoke_import (const char *fname) } -/* +/* * Implementation of `application_handler'. */ -/* +/* Copy a clearsigned message, and strip the signature and PGP's dash-escaping. - + XXX - charset handling: We assume that it is safe to do character set decoding first, dash decoding second here, while we do it the other way around in the main handler. - + (Note that we aren't worse than Outlook & Cie in this, and also note that we can successfully handle anything produced by any existing versions of mutt.) */ @@ -2314,7 +2314,7 @@ static void copy_clearsigned (gpgme_data_t data, STATE *s, char *charset) * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM. */ fc = fgetconv_open (fp, charset, Charset, MUTT_ICONV_HOOK_FROM); - + for (complete = 1, armor_header = 1; fgetconvs (buf, sizeof (buf), fc) != NULL; complete = strchr (buf, '\n') != NULL) @@ -2328,23 +2328,23 @@ static void copy_clearsigned (gpgme_data_t data, STATE *s, char *charset) if (BEGIN_PGP_SIGNATURE(buf)) break; - + if (armor_header) { - if (buf[0] == '\n') + if (buf[0] == '\n') armor_header = 0; continue; } - - if (s->prefix) + + if (s->prefix) state_puts (s->prefix, s); - + if (buf[0] == '-' && buf[1] == ' ') state_puts (buf + 2, s); else state_puts (buf, s); } - + fgetconv_close (&fc); safe_fclose (&fp); } @@ -2377,20 +2377,20 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) fseeko (s->fpin, m->offset, 0); last_pos = m->offset; - + for (bytes = m->length; bytes > 0;) { if (fgets (buf, sizeof (buf), s->fpin) == NULL) break; - + offset = ftello (s->fpin); bytes -= (offset - last_pos); /* don't rely on mutt_strlen(buf) */ last_pos = offset; - + if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15)) { clearsign = 0; - + if (MESSAGE(buf + 15)) needpass = 1; else if (SIGNED_MESSAGE(buf + 15)) @@ -2402,7 +2402,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) { needpass = 0; pgp_keyblock = 1; - } + } else { /* XXX - we may wish to recode here */ @@ -2411,10 +2411,10 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) state_puts (buf, s); continue; } - + have_any_sigs = (have_any_sigs || (clearsign && (s->flags & MUTT_VERIFY))); - + /* Copy PGP material to an data container */ armored_data = file_to_data_object (s->fpin, m->offset, m->length); /* Invoke PGP if needed */ @@ -2454,8 +2454,8 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) if (err) { char errbuf[200]; - - snprintf (errbuf, sizeof(errbuf)-1, + + snprintf (errbuf, sizeof(errbuf)-1, _("Error: decryption/verification failed: %s\n"), gpgme_strerror (err)); state_puts (errbuf, s); @@ -2492,7 +2492,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) } if (!anybad && idx) maybe_goodsig = 1; - + state_attach_puts (_("[-- End signature " "information --]\n\n"), s); } @@ -2512,13 +2512,13 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) gpgme_data_release (plaintext); gpgme_release (ctx); } - + /* * Now, copy cleartext to the screen. NOTE - we expect that PGP - * outputs utf-8 cleartext. This may not always be true, but it + * outputs utf-8 cleartext. This may not always be true, but it * seems to be a reasonable guess. */ - + if(s->flags & MUTT_DISPLAY) { if (needpass) @@ -2530,7 +2530,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) state_attach_puts (_("[-- BEGIN PGP SIGNED MESSAGE --]\n\n"), s); } - + if (clearsign) { copy_clearsigned (armored_data, s, body_charset); @@ -2549,7 +2549,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) } fgetconv_close (&fc); } - + if (s->flags & MUTT_DISPLAY) { state_putc ('\n', s); @@ -2560,7 +2560,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) else state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s); } - + gpgme_data_release (armored_data); if (pgpout) { @@ -2578,7 +2578,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) } m->goodsig = (maybe_goodsig && have_any_sigs); - + if (needpass == -1) { state_attach_puts (_("[-- Error: could not find beginning" @@ -2590,7 +2590,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s) return err; } -/* +/* * Implementation of `encrypted_handler'. */ @@ -2605,7 +2605,7 @@ int pgp_gpgme_encrypted_handler (BODY *a, STATE *s) BODY *tattach; int is_signed; int rc = 0; - + mutt_debug (2, "Entering pgp_encrypted handler\n"); mutt_mktemp (tempfile, sizeof (tempfile)); @@ -2627,7 +2627,7 @@ int pgp_gpgme_encrypted_handler (BODY *a, STATE *s) _("[-- The following data is PGP/MIME signed and encrypted --]\n\n"): _("[-- The following data is PGP/MIME encrypted --]\n\n"), s); - + { FILE *savefp = s->fpin; s->fpin = fpout; @@ -2635,14 +2635,14 @@ int pgp_gpgme_encrypted_handler (BODY *a, STATE *s) s->fpin = savefp; } - /* + /* * if a multipart/signed is the _only_ sub-part of a * multipart/encrypted, cache signature verification * status. */ if (mutt_is_multipart_signed (tattach) && !tattach->next) a->goodsig |= tattach->goodsig; - + if (s->flags & MUTT_DISPLAY) { state_puts ("\n", s); @@ -2679,7 +2679,7 @@ int smime_gpgme_application_handler (BODY *a, STATE *s) int rc = 0; mutt_debug (2, "Entering smime_encrypted handler\n"); - + a->warnsig = 0; mutt_mktemp (tempfile, sizeof (tempfile)); if (!(fpout = safe_fopen (tempfile, "w+"))) @@ -2700,7 +2700,7 @@ int smime_gpgme_application_handler (BODY *a, STATE *s) _("[-- The following data is S/MIME signed --]\n\n"): _("[-- The following data is S/MIME encrypted --]\n\n"), s); - + { FILE *savefp = s->fpin; s->fpin = fpout; @@ -2708,7 +2708,7 @@ int smime_gpgme_application_handler (BODY *a, STATE *s) s->fpin = savefp; } - /* + /* * if a multipart/signed is the _only_ sub-part of a * multipart/encrypted, cache signature verification * status. @@ -2735,18 +2735,18 @@ int smime_gpgme_application_handler (BODY *a, STATE *s) mutt_free_body (&tattach); } - + safe_fclose (&fpout); mutt_unlink(tempfile); mutt_debug (2, "Leaving smime_encrypted handler\n"); - + return rc; } /* * Format an entry on the CRYPT key selection menu. - * + * * %n number * %k key id %K key id of the principal key * %u user id @@ -2787,7 +2787,7 @@ static const char *crypt_entry_fmt (char *dest, kflags = (key->flags /*| (pkey->flags & KEYFLAG_RESTRICTIONS) | uid->flags*/); - + switch (tolower (op)) { case '[': @@ -2964,17 +2964,17 @@ static const char *crypt_entry_fmt (char *dest, mutt_FormatString (dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0); return (src); } - + /* Used by the display function to format a line. */ static void crypt_entry (char *s, size_t l, MUTTMENU * menu, int num) { crypt_key_t **key_table = (crypt_key_t **) menu->data; crypt_entry_t entry; - + entry.key = key_table[num]; entry.num = num + 1; - mutt_FormatString (s, l, 0, MuttIndexWindow->cols, NONULL (PgpEntryFormat), crypt_entry_fmt, + mutt_FormatString (s, l, 0, MuttIndexWindow->cols, NONULL (PgpEntryFormat), crypt_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); } @@ -3113,10 +3113,10 @@ static void print_dn_parts (FILE *fp, struct dn_array_s *dn) { static const char * const stdpart[] = { - "CN", "OU", "O", "STREET", "L", "ST", "C", NULL + "CN", "OU", "O", "STREET", "L", "ST", "C", NULL }; int any=0, any2=0, i; - + for (i=0; stdpart[i]; i++) { if (any) @@ -3191,7 +3191,7 @@ parse_dn_part (struct dn_array_s *array, const char *string) { /* pair */ s++; if (*s == ',' || *s == '=' || *s == '+' - || *s == '<' || *s == '>' || *s == '#' || *s == ';' + || *s == '<' || *s == '>' || *s == '#' || *s == ';' || *s == '\\' || *s == '\"' || *s == ' ') n++; else if (isxdigit (*s) && isxdigit (*(s+1))) @@ -3206,7 +3206,7 @@ parse_dn_part (struct dn_array_s *array, const char *string) return NULL; /* invalid encoding */ else if (*s == ',' || *s == '=' || *s == '+' || *s == '<' || *s == '>' || *s == '#' || *s == ';' ) - break; + break; else n++; } @@ -3216,7 +3216,7 @@ parse_dn_part (struct dn_array_s *array, const char *string) for (s=string; n; s++, n--) { if (*s == '\\') - { + { s++; if (isxdigit (*s)) { @@ -3321,9 +3321,9 @@ parse_and_print_user_id (FILE *fp, const char *userid) struct dn_array_s *dn = parse_dn (userid); if (!dn) fputs (_("[Can't display this user ID (invalid DN)]"), fp); - else + else { - print_dn_parts (fp, dn); + print_dn_parts (fp, dn); for (i=0; dn[i].key; i++) { FREE (&dn[i].key); @@ -3423,11 +3423,11 @@ static void print_key_info (gpgme_key_t key, FILE *fp) /* L10N: DOTFILL */ fprintf (fp, _("Valid From : %s\n"), shortbuf); } - + if (key->subkeys && (key->subkeys->expires > 0)) { tt = key->subkeys->expires; - + tm = localtime (&tt); #ifdef HAVE_LANGINFO_D_T_FMT strftime (shortbuf, sizeof shortbuf, nl_langinfo (D_T_FMT), tm); @@ -3536,7 +3536,7 @@ static void print_key_info (gpgme_key_t key, FILE *fp) idx++, subkey = subkey->next) { s = subkey->keyid; - + putc ('\n', fp); if ( strlen (s) == 16) s += 8; /* display only the short keyID */ @@ -3625,7 +3625,7 @@ static void print_key_info (gpgme_key_t key, FILE *fp) /* Show detailed information about the selected key */ -static void +static void verify_key (crypt_key_t *key) { FILE *fp; @@ -3673,7 +3673,7 @@ verify_key (crypt_key_t *key) goto leave; } gpgme_op_keylist_end (listctx); - + print_key_info (k, fp); if (!--maxdepth) { @@ -3693,7 +3693,7 @@ verify_key (crypt_key_t *key) mutt_do_pager (cmd, tempfile, 0, NULL); } -/* +/* * Implementation of `findkeys'. */ @@ -3768,9 +3768,9 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) pattern = list_to_pattern (hints); if (!pattern) return NULL; - + err = gpgme_new (&ctx); - if (err) + if (err) { mutt_error (_("gpgme_new failed: %s"), gpgme_strerror (err)); FREE (&pattern); @@ -3779,7 +3779,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) db = NULL; kend = &db; - + if ((app & APPLICATION_PGP)) { /* It's all a mess. That old GPGME expects different things @@ -3809,7 +3809,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) for (n=0; patarr[n]; n++) FREE (&patarr[n]); FREE (&patarr); - if (err) + if (err) { mutt_error (_("gpgme_op_keylist_start failed: %s"), gpgme_strerror (err)); @@ -3821,7 +3821,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) while (!(err = gpgme_op_keylist_next (ctx, &key)) ) { unsigned int flags = 0; - + if (key_check_cap (key, KEY_CAP_CAN_ENCRYPT)) flags |= KEYFLAG_CANENCRYPT; if (key_check_cap (key, KEY_CAP_CAN_SIGN)) @@ -3884,7 +3884,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) /* and now look for x509 certificates */ gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS); err = gpgme_op_keylist_start (ctx, pattern, 0); - if (err) + if (err) { mutt_error (_("gpgme_op_keylist_start failed: %s"), gpgme_strerror (err)); @@ -3901,7 +3901,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) flags |= KEYFLAG_CANENCRYPT; if (key_check_cap (key, KEY_CAP_CAN_SIGN)) flags |= KEYFLAG_CANSIGN; - + for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) { k = safe_calloc (1, sizeof *k); @@ -3942,7 +3942,7 @@ static LIST *crypt_add_string_to_hints (LIST *hints, const char *str) if (strlen (t) > 3) hints = mutt_add_list (hints, t); } - + FREE (&scratch); return hints; } @@ -3951,7 +3951,7 @@ static LIST *crypt_add_string_to_hints (LIST *hints, const char *str) will be set to true on return if the user did override the key's validity. */ static crypt_key_t *crypt_select_key (crypt_key_t *keys, - ADDRESS * p, const char *s, + ADDRESS * p, const char *s, unsigned int app, int *forced_valid) { int keymax; @@ -3976,13 +3976,13 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys, unusable = 1; continue; } - + if (i == keymax) { keymax += 20; safe_realloc (&key_table, sizeof (crypt_key_t*)*keymax); } - + key_table[i++] = k; } @@ -4056,7 +4056,7 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys, /* L10N: e.g. 'S/MIME keys matching "Michael Elkins".' */ snprintf (buf, sizeof (buf), _("%s \"%s\"."), ts, s); - menu->title = buf; + menu->title = buf; } mutt_clear_error (); @@ -4070,11 +4070,11 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys, verify_key (key_table[menu->current]); menu->redraw = REDRAW_FULL; break; - + case OP_VIEW_ID: mutt_message ("%s", key_table[menu->current]->uid); break; - + case OP_GENERIC_SELECT_ENTRY: /* FIXME make error reporting more verbose - this should be easy because gpgme provides more information */ @@ -4087,33 +4087,33 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys, break; } } - + if (option (OPTPGPCHECKTRUST) && (!crypt_id_is_valid (key_table[menu->current]) || !crypt_id_is_strong (key_table[menu->current]))) { const char *warn_s; char buff[LONG_STRING]; - + if (key_table[menu->current]->flags & KEYFLAG_CANTUSE) warn_s = N_("ID is expired/disabled/revoked."); - else + else { warn_s = "??"; switch (key_table[menu->current]->validity) { - case GPGME_VALIDITY_UNKNOWN: - case GPGME_VALIDITY_UNDEFINED: + case GPGME_VALIDITY_UNKNOWN: + case GPGME_VALIDITY_UNDEFINED: warn_s = N_("ID has undefined validity."); break; - case GPGME_VALIDITY_NEVER: + case GPGME_VALIDITY_NEVER: warn_s = N_("ID is not valid."); break; - case GPGME_VALIDITY_MARGINAL: + case GPGME_VALIDITY_MARGINAL: warn_s = N_("ID is only marginally valid."); break; - case GPGME_VALIDITY_FULL: - case GPGME_VALIDITY_ULTIMATE: + case GPGME_VALIDITY_FULL: + case GPGME_VALIDITY_ULTIMATE: break; } } @@ -4121,31 +4121,31 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys, snprintf (buff, sizeof (buff), _("%s Do you really want to use the key?"), _(warn_s)); - + if (mutt_yesorno (buff, 0) != MUTT_YES) { mutt_clear_error (); break; } *forced_valid = 1; - } + } k = crypt_copy_key (key_table[menu->current]); done = 1; break; - + case OP_EXIT: k = NULL; done = 1; break; } } - + mutt_menuDestroy (&menu); FREE (&key_table); set_option (OPTNEEDREDRAW); - + return k; } @@ -4171,7 +4171,7 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, crypt_key_t *a_valid_addrmatch_key = NULL; crypt_key_t *matches = NULL; crypt_key_t **matches_endp = &matches; - + *forced_valid = 0; if (a && a->mailbox) @@ -4184,10 +4184,10 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, keys = get_candidates (hints, app, (abilities & KEYFLAG_CANSIGN) ); mutt_free_list (&hints); - + if (!keys) return NULL; - + mutt_debug (5, "crypt_getkeybyaddr: looking for %s <%s>.", a->personal, a->mailbox); @@ -4195,7 +4195,7 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, { mutt_debug (5, " looking at key: %s `%.15s'\n", crypt_keyid (k), k->uid); - + if (abilities && !(k->flags & abilities)) { mutt_debug (5, " insufficient abilities: Has %x, want %x\n", @@ -4213,7 +4213,7 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, for (p = r; p; p = p->next) { int validity = crypt_id_matches_addr (a, p, k); - + if (validity & CRYPT_KV_MATCH) /* something matches */ { match = 1; @@ -4240,7 +4240,7 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, } } rfc822_free_address (&r); - + if (match) { crypt_key_t *tmp; @@ -4261,9 +4261,9 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, weak = 1; } } - + crypt_free_key (&keys); - + if (matches) { if (oppenc_mode) @@ -4277,19 +4277,19 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, } else if (the_strong_valid_key && !multi && !weak && !addr_match && !(invalid && option (OPTPGPSHOWUNUSABLE))) - { - /* + { + /* * There was precisely one strong match on a valid ID, there * were no valid keys with weak matches, and we aren't * interested in seeing invalid keys. - * + * * Proceed without asking the user. */ k = crypt_copy_key (the_strong_valid_key); } - else + else { - /* + /* * Else: Ask the user. */ k = crypt_select_key (matches, a, NULL, app, forced_valid); @@ -4297,9 +4297,9 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, crypt_free_key (&matches); } - else + else k = NULL; - + return k; } @@ -4351,17 +4351,17 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities, matches_endp = &tmp->next; } } - + FREE (&pfcopy); crypt_free_key (&keys); - + if (matches) { k = crypt_select_key (matches, NULL, p, app, forced_valid); crypt_free_key (&matches); return k; } - + return NULL; } @@ -4370,8 +4370,8 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities, default. ABILITIES describe the required key abilities (sign, encrypt) and APP the type of the requested key; ether S/MIME or PGP. Return a copy of the key or NULL if not found. */ -static crypt_key_t *crypt_ask_for_key (char *tag, - char *whatfor, +static crypt_key_t *crypt_ask_for_key (char *tag, + char *whatfor, short abilities, unsigned int app, int *forced_valid) @@ -4390,7 +4390,7 @@ static crypt_key_t *crypt_ask_for_key (char *tag, resp[0] = 0; if (whatfor) { - + for (l = id_defaults; l; l = l->next) if (!mutt_strcasecmp (whatfor, l->what)) { @@ -4405,7 +4405,7 @@ static crypt_key_t *crypt_ask_for_key (char *tag, resp[0] = 0; if (mutt_get_field (tag, resp, sizeof (resp), MUTT_CLEAR) != 0) return NULL; - + if (whatfor) { if (l) @@ -4419,10 +4419,10 @@ static crypt_key_t *crypt_ask_for_key (char *tag, l->dflt = safe_strdup (resp); } } - + if ((key = crypt_getkeybystr (resp, abilities, app, forced_valid))) return key; - + BEEP (); } /* not reached */ @@ -4484,7 +4484,7 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) } /* check for e-mail address */ - if ((t = strchr (crypt_hook_val, '@')) && + if ((t = strchr (crypt_hook_val, '@')) && (addr = rfc822_parse_adrlist (NULL, crypt_hook_val))) { if (fqdn) @@ -4493,11 +4493,11 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) } else if (! oppenc_mode) { -#if 0 - k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, +#if 0 + k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, *r_application, &forced_valid); #else - k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, + k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, app, &forced_valid); #endif } @@ -4528,7 +4528,7 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) if ((k_info == NULL) && (! oppenc_mode)) { snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox); - + k_info = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT, #if 0 @@ -4556,7 +4556,7 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) if (!(k_info->flags & KEYFLAG_ISX509)) *r_application &= ~APPLICATION_SMIME; #endif - + bypass_selection: keylist_size += mutt_strlen (keyID) + 4 + 1; safe_realloc (&keylist, keylist_size); @@ -4818,7 +4818,7 @@ static int gpgme_send_menu (HEADER *msg, int *redraw, int is_smime) snprintf (input_signas, sizeof (input_signas), "0x%s", crypt_fpr_or_lkeyid (p)); mutt_str_replace (is_smime? &SmimeDefaultKey : &PgpSignAs, input_signas); - crypt_free_key (&p); + crypt_free_key (&p); msg->security |= SIGN; } diff --git a/crypt-gpgme.h b/crypt-gpgme.h index 7f5ecda37..fbcb3881e 100644 --- a/crypt-gpgme.h +++ b/crypt-gpgme.h @@ -1,16 +1,16 @@ -/* +/* * Copyright (C) 2004 g10 Code GmbH * * 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. diff --git a/crypt-mod-pgp-classic.c b/crypt-mod-pgp-classic.c index 2f69dcdc5..4de70f02d 100644 --- a/crypt-mod-pgp-classic.c +++ b/crypt-mod-pgp-classic.c @@ -1,22 +1,22 @@ -/* +/* * Copyright (C) 2004 g10 Code GmbH * * 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 is a crytpo module wrapping the classic pgp code. */ diff --git a/crypt-mod-pgp-gpgme.c b/crypt-mod-pgp-gpgme.c index 183f4eeec..13193999a 100644 --- a/crypt-mod-pgp-gpgme.c +++ b/crypt-mod-pgp-gpgme.c @@ -1,22 +1,22 @@ -/* +/* * Copyright (C) 2004 g10 Code GmbH * * 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 is a crytpo module wrapping the gpgme based pgp code. */ diff --git a/crypt-mod-smime-classic.c b/crypt-mod-smime-classic.c index c09db9c71..7e341dfc8 100644 --- a/crypt-mod-smime-classic.c +++ b/crypt-mod-smime-classic.c @@ -1,22 +1,22 @@ -/* +/* * Copyright (C) 2004 g10 Code GmbH * * 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 is a crytpo module wrapping the classic smime code. */ @@ -109,7 +109,7 @@ struct crypt_module_specs crypt_mod_smime_classic = NULL, /* pgp_invoke_getkeys */ NULL, /* pgp_invoke_import */ NULL, /* pgp_extract_keys_from_attachment_list */ - + crypt_mod_smime_getkeys, crypt_mod_smime_verify_sender, crypt_mod_smime_build_smime_entity, diff --git a/crypt-mod-smime-gpgme.c b/crypt-mod-smime-gpgme.c index ec1b2ba65..d0cab74f5 100644 --- a/crypt-mod-smime-gpgme.c +++ b/crypt-mod-smime-gpgme.c @@ -1,22 +1,22 @@ -/* +/* * Copyright (C) 2004 g10 Code GmbH * * 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 is a crytpo module wrapping the gpgme based smime code. */ @@ -107,7 +107,7 @@ struct crypt_module_specs crypt_mod_smime_gpgme = NULL, /* pgp_invoke_getkeys */ NULL, /* pgp_invoke_import */ NULL, /* pgp_extract_keys_from_attachment_list */ - + NULL, /* smime_getkeys */ crypt_mod_smime_verify_sender, crypt_mod_smime_build_smime_entity, diff --git a/crypt-mod.c b/crypt-mod.c index a899a9b01..25238c69d 100644 --- a/crypt-mod.c +++ b/crypt-mod.c @@ -5,12 +5,12 @@ * 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. diff --git a/crypt-mod.h b/crypt-mod.h index 0a5cc2e4f..574eed6ca 100644 --- a/crypt-mod.h +++ b/crypt-mod.h @@ -5,12 +5,12 @@ * 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. @@ -25,7 +25,7 @@ #define CRYPTO_SUPPORT(identifier) (WithCrypto & APPLICATION_ ## identifier) -/* +/* Type definitions for crypto module functions. */ typedef void (*crypt_func_void_passphrase_t) (void); @@ -50,7 +50,7 @@ typedef BODY *(*crypt_func_pgp_encrypt_message_t) (BODY *a, char *keylist, typedef void (*crypt_func_pgp_invoke_import_t) (const char *fname); typedef int (*crypt_func_verify_one_t) (BODY *sigbdy, STATE *s, const char *tempf); -typedef void (*crypt_func_pgp_extract_keys_from_attachment_list_t) +typedef void (*crypt_func_pgp_extract_keys_from_attachment_list_t) (FILE *fp, int tag, BODY *top); typedef int (*crypt_func_send_menu_t) (HEADER *msg, int *redraw); @@ -106,7 +106,7 @@ typedef struct crypt_module_functions /* - A structure to describe a crypto module. + A structure to describe a crypto module. */ typedef struct crypt_module_specs { @@ -116,8 +116,8 @@ typedef struct crypt_module_specs -/* - High Level crypto module interface. +/* + High Level crypto module interface. */ void crypto_module_register (crypt_module_specs_t specs); diff --git a/crypt.c b/crypt.c index a0085fa93..252005e3a 100644 --- a/crypt.c +++ b/crypt.c @@ -10,12 +10,12 @@ * 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. @@ -290,7 +290,7 @@ int mutt_protect (HEADER *msg, char *keylist) return (-1); } - /* destroy temporary signature envelope when doing retainable + /* destroy temporary signature envelope when doing retainable * signatures. */ @@ -309,8 +309,8 @@ int mutt_protect (HEADER *msg, char *keylist) } - - + + int mutt_is_multipart_signed (BODY *b) { char *p; @@ -328,7 +328,7 @@ int mutt_is_multipart_signed (BODY *b) if ((WithCrypto & APPLICATION_PGP) && !(ascii_strcasecmp (p, "application/pgp-signature"))) return PGPSIGN; - + if ((WithCrypto & APPLICATION_SMIME) && !(ascii_strcasecmp (p, "application/x-pkcs7-signature"))) return SMIMESIGN; @@ -338,20 +338,20 @@ int mutt_is_multipart_signed (BODY *b) return 0; } - - + + int mutt_is_multipart_encrypted (BODY *b) { if ((WithCrypto & APPLICATION_PGP)) { char *p; - + if (!b || b->type != TYPEMULTIPART || !b->subtype || ascii_strcasecmp (b->subtype, "encrypted") || !(p = mutt_get_parameter ("protocol", b->parameter)) || ascii_strcasecmp (p, "application/pgp-encrypted")) return 0; - + return PGPENCRYPT; } @@ -424,7 +424,7 @@ int mutt_is_application_pgp (BODY *m) { int t = 0; char *p; - + if (m->type == TYPEAPPLICATION) { if (!ascii_strcasecmp (m->subtype, "pgp") || !ascii_strcasecmp (m->subtype, "x-pgp-message")) @@ -433,7 +433,7 @@ int mutt_is_application_pgp (BODY *m) && (!ascii_strcasecmp (p, "sign") || !ascii_strcasecmp (p, "signclear"))) t |= PGPSIGN; - if ((p = mutt_get_parameter ("format", m->parameter)) && + if ((p = mutt_get_parameter ("format", m->parameter)) && !ascii_strcasecmp (p, "keys-only")) t |= PGPKEY; @@ -449,7 +449,7 @@ int mutt_is_application_pgp (BODY *m) else if (m->type == TYPETEXT && ascii_strcasecmp ("plain", m->subtype) == 0) { if (((p = mutt_get_parameter ("x-mutt-action", m->parameter)) - || (p = mutt_get_parameter ("x-action", m->parameter)) + || (p = mutt_get_parameter ("x-action", m->parameter)) || (p = mutt_get_parameter ("action", m->parameter))) && !ascii_strncasecmp ("pgp-sign", p, 8)) t |= PGPSIGN; @@ -486,7 +486,7 @@ int mutt_is_application_smime (BODY *m) return (SMIMESIGN|SMIMEOPAQUE); else return 0; } - /* Netscape 4.7 uses + /* Netscape 4.7 uses * Content-Description: S/MIME Encrypted Message * instead of Content-Type parameter */ @@ -501,7 +501,7 @@ int mutt_is_application_smime (BODY *m) if (!t) t = m->d_filename; if (!t) t = m->filename; - if (!t) + if (!t) { if (complain) mutt_message (_("S/MIME messages with no hints on content are unsupported.")); @@ -518,7 +518,7 @@ int mutt_is_application_smime (BODY *m) #if 0 return SMIMEENCRYPT; #else - /* Not sure if this is the correct thing to do, but + /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ return (SMIMESIGN|SMIMEOPAQUE); #endif @@ -541,7 +541,7 @@ int crypt_query (BODY *m) if (!WithCrypto) return 0; - + if (!m) return 0; @@ -563,14 +563,14 @@ int crypt_query (BODY *m) if (t && m->goodsig) t |= GOODSIGN; } - + if (m->type == TYPEMULTIPART) { t |= mutt_is_multipart_encrypted(m); t |= mutt_is_multipart_signed (m); t |= mutt_is_malformed_multipart_pgp_encrypted (m); - if (t && m->goodsig) + if (t && m->goodsig) t |= GOODSIGN; } @@ -578,17 +578,17 @@ int crypt_query (BODY *m) { BODY *p; int u, v, w; - + u = m->parts ? 0xffffffff : 0; /* Bits set in all parts */ w = 0; /* Bits set in any part */ - + for (p = m->parts; p; p = p->next) { v = crypt_query (p); u &= v; w |= v; } t |= u | (w & ~GOODSIGN); - + if ((w & GOODSIGN) && !(u & GOODSIGN)) t |= PARTSIGN; } @@ -614,7 +614,7 @@ int crypt_write_signed(BODY *a, STATE *s, const char *tempfile) mutt_perror (tempfile); return -1; } - + fseeko (s->fpin, a->hdr_offset, 0); bytes = a->length + a->offset - a->hdr_offset; hadcr = 0; @@ -622,21 +622,21 @@ int crypt_write_signed(BODY *a, STATE *s, const char *tempfile) { if ((c = fgetc (s->fpin)) == EOF) break; - + bytes--; - + if (c == '\r') hadcr = 1; - else + else { if (c == '\n' && !hadcr) fputc ('\r', fp); - + hadcr = 0; } - + fputc (c, fp); - + } safe_fclose (&fp); @@ -661,7 +661,7 @@ void convert_to_7bit (BODY *a) } else if ((WithCrypto & APPLICATION_PGP) && option (OPTPGPSTRICTENC)) convert_to_7bit (a->parts); - } + } else if (a->type == TYPEMESSAGE && ascii_strcasecmp(a->subtype, "delivery-status")) { @@ -673,7 +673,7 @@ void convert_to_7bit (BODY *a) else if (a->encoding == ENCBINARY) a->encoding = ENCBASE64; else if (a->content && a->encoding != ENCBASE64 && - (a->content->from || (a->content->space && + (a->content->from || (a->content->space && option (OPTPGPSTRICTENC)))) a->encoding = ENCQUOTEDPRINTABLE; a = a->next; @@ -720,10 +720,10 @@ void crypt_extract_keys_from_messages (HEADER * h) if ((WithCrypto & APPLICATION_PGP) && (Context->hdrs[Context->v2r[i]]->security & APPLICATION_PGP)) { - mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]], + mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]], MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0); fflush(fpout); - + mutt_endwin (_("Trying to extract PGP keys...\n")); crypt_pgp_invoke_import (tempfname); } @@ -784,7 +784,7 @@ void crypt_extract_keys_from_messages (HEADER * h) fflush(fpout); if (h->env->from) tmp = mutt_expand_aliases (h->env->from); - else if (h->env->sender) tmp = mutt_expand_aliases (h->env->sender); + else if (h->env->sender) tmp = mutt_expand_aliases (h->env->sender); mbox = tmp ? tmp->mailbox : NULL; if (mbox) /* else ? */ { @@ -794,7 +794,7 @@ void crypt_extract_keys_from_messages (HEADER * h) } } } - + safe_fclose (&fpout); if (isendwin()) mutt_any_key_to_continue (NULL); @@ -856,7 +856,7 @@ int crypt_get_keys (HEADER *msg, char **keylist, int oppenc_mode) } rfc822_free_address (&adrlist); - + return (0); } @@ -919,7 +919,7 @@ int mutt_signed_handler (BODY *a, STATE *s) char tempfile[_POSIX_PATH_MAX]; int signed_type; int inconsistent = 0; - + BODY *b = a; BODY **signatures = NULL; int sigcnt = 0; @@ -977,9 +977,9 @@ int mutt_signed_handler (BODY *a, STATE *s) if (s->flags & MUTT_DISPLAY) { - + crypt_fetch_signatures (&signatures, a->next, &sigcnt); - + if (sigcnt) { mutt_mktemp (tempfile, sizeof (tempfile)); @@ -988,23 +988,23 @@ int mutt_signed_handler (BODY *a, STATE *s) for (i = 0; i < sigcnt; i++) { if ((WithCrypto & APPLICATION_PGP) - && signatures[i]->type == TYPEAPPLICATION + && signatures[i]->type == TYPEAPPLICATION && !ascii_strcasecmp (signatures[i]->subtype, "pgp-signature")) { if (crypt_pgp_verify_one (signatures[i], s, tempfile) != 0) goodsig = 0; - + continue; } if ((WithCrypto & APPLICATION_SMIME) - && signatures[i]->type == TYPEAPPLICATION + && signatures[i]->type == TYPEAPPLICATION && (!ascii_strcasecmp(signatures[i]->subtype, "x-pkcs7-signature") || !ascii_strcasecmp(signatures[i]->subtype, "pkcs7-signature"))) { if (crypt_smime_verify_one (signatures[i], s, tempfile) != 0) goodsig = 0; - + continue; } @@ -1013,12 +1013,12 @@ int mutt_signed_handler (BODY *a, STATE *s) TYPE(signatures[i]), signatures[i]->subtype); } } - + mutt_unlink (tempfile); b->goodsig = goodsig; b->badsig = !goodsig; - + /* Now display the signed body */ state_attach_puts (_("[-- The following data is signed --]\n\n"), s); @@ -1028,12 +1028,12 @@ int mutt_signed_handler (BODY *a, STATE *s) else state_attach_puts (_("[-- Warning: Can't find any signatures. --]\n\n"), s); } - + rc = mutt_body_handler (a, s); - + if (s->flags & MUTT_DISPLAY && sigcnt) state_attach_puts (_("\n[-- End of signed data --]\n"), s); - + return rc; } diff --git a/cryptglue.c b/cryptglue.c index 23c782f2c..6a0f79b5d 100644 --- a/cryptglue.c +++ b/cryptglue.c @@ -6,12 +6,12 @@ * 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. @@ -38,7 +38,7 @@ #include "crypt-mod.h" /* - + Generic */ @@ -113,7 +113,7 @@ void crypt_invoke_message (int type) } -/* +/* PGP @@ -150,7 +150,7 @@ int crypt_pgp_application_pgp_handler (BODY *m, STATE *s) { if (CRYPT_MOD_CALL_CHECK (PGP, application_handler)) return (CRYPT_MOD_CALL (PGP, application_handler)) (m, s); - + return -1; } @@ -159,7 +159,7 @@ int crypt_pgp_encrypted_handler (BODY *a, STATE *s) { if (CRYPT_MOD_CALL_CHECK (PGP, encrypted_handler)) return (CRYPT_MOD_CALL (PGP, encrypted_handler)) (a, s); - + return -1; } @@ -269,9 +269,9 @@ void crypt_pgp_set_sender (const char *sender) -/* +/* - S/MIME + S/MIME */ @@ -305,7 +305,7 @@ int crypt_smime_application_smime_handler (BODY *m, STATE *s) { if (CRYPT_MOD_CALL_CHECK (SMIME, application_handler)) return (CRYPT_MOD_CALL (SMIME, application_handler)) (m, s); - + return -1; } diff --git a/curs_lib.c b/curs_lib.c index 296124fd4..05b339111 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2002,2010,2012-2013 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH - * + * * 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" @@ -165,7 +165,7 @@ int _mutt_get_field (const char *field, char *buf, size_t buflen, int complete, int x; ENTER_STATE *es = mutt_new_enter_state(); - + do { mutt_window_clearline (MuttMessageWindow, 0); @@ -179,7 +179,7 @@ int _mutt_get_field (const char *field, char *buf, size_t buflen, int complete, while (ret == 1); mutt_window_clearline (MuttMessageWindow, 0); mutt_free_enter_state (&es); - + return (ret); } @@ -204,7 +204,7 @@ void mutt_clear_error (void) void mutt_edit_file (const char *editor, const char *data) { char cmd[LONG_STRING]; - + mutt_endwin (NULL); mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data); if (mutt_system (cmd)) @@ -238,7 +238,7 @@ int mutt_yesorno (const char *msg, int def) char answer[2]; answer[1] = 0; - + reyes_ok = (expr = nl_langinfo (YESEXPR)) && expr[0] == '^' && !REGCOMP (&reyes, expr, REG_NOSUB); reno_ok = (expr = nl_langinfo (NOEXPR)) && expr[0] == '^' && @@ -277,7 +277,7 @@ int mutt_yesorno (const char *msg, int def) #ifdef HAVE_LANGINFO_YESEXPR answer[0] = ch.ch; - if (reyes_ok ? + if (reyes_ok ? (regexec (& reyes, answer, 0, 0, 0) == 0) : #else if ( @@ -303,7 +303,7 @@ int mutt_yesorno (const char *msg, int def) } } -#ifdef HAVE_LANGINFO_YESEXPR +#ifdef HAVE_LANGINFO_YESEXPR if (reyes_ok) regfree (& reyes); if (reno_ok) @@ -710,7 +710,7 @@ void mutt_show_error (void) { if (option (OPTKEEPQUIET)) return; - + SETCOLOR (option (OPTMSGERR) ? MT_COLOR_ERROR : MT_COLOR_MESSAGE); mutt_window_mvaddstr (MuttMessageWindow, 0, 0, Errorbuf); NORMAL_COLOR; @@ -729,7 +729,7 @@ void mutt_endwin (const char *msg) mutt_refresh(); endwin (); } - + if (msg && *msg) { puts (msg); @@ -782,13 +782,13 @@ int mutt_do_pager (const char *banner, pager_t *info) { int rc; - + if (!Pager || mutt_strcmp (Pager, "builtin") == 0) rc = mutt_pager (banner, tempfile, do_color, info); else { char cmd[STRING]; - + mutt_endwin (NULL); mutt_expand_file_fmt (cmd, sizeof(cmd), Pager, tempfile); if (mutt_system (cmd) == -1) @@ -921,12 +921,12 @@ void mutt_flushinp (void) void mutt_curs_set (int cursor) { static int SavedCursor = 1; - + if (cursor < 0) cursor = SavedCursor; else SavedCursor = cursor; - + if (curs_set (cursor) == ERR) { if (cursor == 1) /* cnorm */ curs_set (2); /* cvvis */ diff --git a/curs_main.c b/curs_main.c index 4a480f62d..0594de28a 100644 --- a/curs_main.c +++ b/curs_main.c @@ -2030,7 +2030,7 @@ int mutt_index_menu (void) else break; } - + /* Selected directory is okay, let's save it.*/ mutt_browser_select_dir (buf); diff --git a/date.c b/date.c index 43fbeced0..aa45afdd0 100644 --- a/date.c +++ b/date.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" @@ -184,7 +184,7 @@ void mutt_normalize_time (struct tm *tm) } tm->tm_mday += DaysPerMonth[tm->tm_mon] + isLeapYearFeb (tm); } - while (tm->tm_mday > (DaysPerMonth[tm->tm_mon] + + while (tm->tm_mday > (DaysPerMonth[tm->tm_mon] + (nLeap = isLeapYearFeb (tm)))) { tm->tm_mday -= DaysPerMonth[tm->tm_mon] + nLeap; diff --git a/doc/Muttrc.head b/doc/Muttrc.head index dd5b3c570..c09a19bc1 100644 --- a/doc/Muttrc.head +++ b/doc/Muttrc.head @@ -86,7 +86,7 @@ attachments -A application/x-pkcs7-.* ## message flow?) ## attachments +I text/plain - + ## These two lines make Mutt qualify MIME containers. (So, for example, ## a message/rfc822 forward will count as an attachment.) The first ## line is unnecessary if you already have "attach-allow */.*", of diff --git a/doc/PGP-Notes.txt b/doc/PGP-Notes.txt index b292edbce..e152eb1d8 100644 --- a/doc/PGP-Notes.txt +++ b/doc/PGP-Notes.txt @@ -47,7 +47,7 @@ using procmail, aren't you?): ## ## PGP ## - + :0 * !^Content-Type: message/ * !^Content-Type: multipart/ @@ -82,7 +82,7 @@ EPGPS="-----END PGP SIGNATURE-----" if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \ && !/^Content-Type: application\/pgp/) -{ +{ if (/^$BPGPM/:b && /^$EPGPM/:b) xfilter "reformail -A 'Content-Type: application/pgp; format=text; \ x-action=encrypt'" @@ -176,10 +176,10 @@ Command line options: -k Dump the contents of the key ring specified as an argument to -k. - - -2, -5 Use the default key ring for PGP 2 or 5, + + -2, -5 Use the default key ring for PGP 2 or 5, respectively. - + -s Dump the secret key ring. -S Dump signatures. @@ -239,7 +239,7 @@ The following command formats are defined: $pgp_decode_command Decode application/pgp messages. This command operates with and without pass phrases. - + $pgp_verify_command Verify a PGP/MIME signature. $pgp_decrypt_command Decrypt a PGP/MIME encrypted MIME body. @@ -251,14 +251,14 @@ The following command formats are defined: $pgp_encrypt_sign_command Encrypt and sign a MIME body. This command always gets a pass phrase. - + $pgp_encrypt_only_command Encrypt a MIME body, but don't sign it. - + $pgp_import_command Import PGP keys from a file. - + $pgp_export_command Export PGP keys to a file. The output must be ASCII armored. - + $pgp_verify_key_command Check a public key. This is used from the key selection menu. diff --git a/doc/devel-notes.txt b/doc/devel-notes.txt index 4eede0fe5..3094054a3 100644 --- a/doc/devel-notes.txt +++ b/doc/devel-notes.txt @@ -44,7 +44,7 @@ You'll need several GNU development utilities for working on mutt: --- gettext.m4.bak Thu Jul 2 18:46:08 1998 +++ gettext.m4 Mon Oct 5 23:32:54 1998 @@ -46,12 +46,13 @@ - + if test "$gt_cv_func_gettext_libc" != "yes"; then AC_CHECK_LIB(intl, bindtextdomain, - [AC_CACHE_CHECK([for gettext in libintl], @@ -60,7 +60,7 @@ You'll need several GNU development utilities for working on mutt: + if test "$gt_cv_func_gettext_libintl" = "yes" ; then + LIBS="-lintl $LIBS" fi - + if test "$gt_cv_func_gettext_libc" = "yes" \ diff --git a/doc/dotlock.man b/doc/dotlock.man index 39768c47d..7fab256d5 100644 --- a/doc/dotlock.man +++ b/doc/dotlock.man @@ -3,17 +3,17 @@ .\" .\" Copyright (C) 1996-8 Michael R. Elkins .\" Copyright (C) 1998-9 Thomas Roessler -.\" +.\" .\" 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. @@ -23,7 +23,7 @@ mutt_dotlock \- Lock mail spool files. .SH SYNOPSIS .PP -.B mutt_dotlock +.B mutt_dotlock [\-t|\-f|\-u|\-d] [\-p] [\-r \fIretries\fP] \fIfile\fP .SH DESCRIPTION .PP @@ -41,12 +41,12 @@ won't actually lock a file, but inform the invoking process if it's at all possible to lock \fIfile\fP. .IP "-f" Force the lock. If another process holds a lock on -\fIfile\fP longer than a certain amount of time, +\fIfile\fP longer than a certain amount of time, .B mutt_dotlock will break that lock by removing the lockfile. .IP "-u" Unlock. -.B mutt_dotlock +.B mutt_dotlock will remove \fIfile\fP.lock. .IP "-d" Delete. @@ -54,24 +54,24 @@ Delete. will lock \fIfile\fP, remove it if it has length 0, and afterwards remove \fIfile\fP.lock. .IP "-p" -Use privileges. If given this option, +Use privileges. If given this option, .B mutt_dotlock will operate with group mail privileges when creating and deleting lock files. .IP "-r \fIretries\fP" -This command line option tells -.B mutt_dotlock +This command line option tells +.B mutt_dotlock to try locking \fIretries\fP times before giving up or (if invoked with -the +the .B -f command line option) break a lock. The default value is 5. .B mutt_dotlock -waits one second between successive locking attempts. +waits one second between successive locking attempts. .SH FILES .PP .IP "\fIfile\fP.lock" -The lock file +The lock file .B mutt_dotlock generates. .SH SEE ALSO @@ -87,28 +87,28 @@ gives all diagnostics in its return values: .TP .B "0 \- DL_EX_OK" The program was successful. -.TP +.TP .B "1 \- DL_EX_ERROR" An unspecified error such as bad command line parameters, lack of system memory and the like has occurred. -.TP +.TP .B "3 \- DL_EX_EXIST" -The +The user wants to lock a file which has been locked by -another process already. If +another process already. If .B mutt_dotlock is invoked with the -.B -f -command line option, +.B -f +command line option, .B mutt_dotlock won't generate this error, but break other processes' locks. -.TP +.TP .B "4 \- DL_EX_NEED_RPIVS" -This return value only occurs if -.B mutt_dotlock +This return value only occurs if +.B mutt_dotlock has been invoked -with the +with the .B -t command line option. It means that .B mutt_dotlock @@ -121,20 +121,20 @@ This return value only occurs if has been invoked with the .B -t command line option. It means that -.B mutt_dotlock +.B mutt_dotlock is unable to lock \fIfile\fP even with group mail privileges. .SH NOTES .PP .B mutt_dotlock tries to implement an NFS-safe dotlocking method which was -borrowed from +borrowed from .B lockfile -(1). +(1). .PP If the user can't open \fIfile\fP for reading with his -normal privileges, -.B mutt_dotlock +normal privileges, +.B mutt_dotlock will return the .B DL_EX_ERROR exit value to avoid certain attacks against other users' diff --git a/doc/makedoc.c b/doc/makedoc.c index cc60f298c..f77e9368a 100644 --- a/doc/makedoc.c +++ b/doc/makedoc.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2000 Thomas Roessler - * + * * 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 program parses mutt's init.h and generates documentation in @@ -22,7 +22,7 @@ ** ** -> a commented muttrc configuration file ** -> nroff, suitable for inclusion in a manual page - ** -> docbook-xml, suitable for inclusion in the + ** -> docbook-xml, suitable for inclusion in the ** SGML-based manual ** **/ @@ -125,7 +125,7 @@ int main (int argc, char *argv[]) Progname++; else Progname = argv[0]; - + while ((c = getopt (argc, argv, "cmsd")) != EOF) { switch (c) @@ -134,7 +134,7 @@ int main (int argc, char *argv[]) case 'm': OutputFormat = F_MAN; break; case 's': OutputFormat = F_SGML; break; case 'd': Debug++; break; - default: + default: { fprintf (stderr, "%s: bad command line parameter.\n", Progname); exit (1); @@ -151,13 +151,13 @@ int main (int argc, char *argv[]) exit (1); } } - else + else f = stdin; switch (OutputFormat) { - case F_CONF: - case F_MAN: + case F_CONF: + case F_MAN: case F_SGML: makedoc (f, stdout); break; default: { @@ -166,7 +166,7 @@ int main (int argc, char *argv[]) exit (1); } } - + if (f != stdin) fclose (f); @@ -203,7 +203,7 @@ static void makedoc (FILE *in, FILE *out) fprintf (stderr, "%s: line %d. first token: \"%s\".\n", Progname, line, token); } - + if (!strcmp (token, "/*++*/")) active = 1; else if (!strcmp (token, "/*--*/")) @@ -246,7 +246,7 @@ static char *get_token (char *d, size_t l, char *s) if (Debug) fprintf (stderr, "%s: get_token called for `%s'.\n", Progname, s); - + s = skip_ws (s); if (Debug > 1) @@ -278,7 +278,7 @@ static char *get_token (char *d, size_t l, char *s) { fprintf (stderr, "%s: found quote character.\n", Progname); } - + s++; is_quoted = 1; } @@ -324,14 +324,14 @@ static char *get_token (char *d, size_t l, char *s) fprintf (stderr, "%s: Remainder: `%s'.\n", Progname, t); } - + return t; } /** ** Configuration line parser - ** + ** ** The following code parses a line from init.h which declares ** a configuration variable. ** @@ -341,7 +341,7 @@ static char *get_token (char *d, size_t l, char *s) * following string definitions! */ -enum +enum { DT_NONE = 0, DT_BOOL, @@ -357,12 +357,12 @@ enum DT_MBCHARTBL }; -struct +struct { char *machine; char *human; } -types[] = +types[] = { { "DT_NONE", "-none-" }, { "DT_BOOL", "boolean" }, @@ -378,16 +378,16 @@ types[] = { "DT_MBCHARTBL", "string" }, { NULL, NULL } }; - + static int buff2type (const char *s) { int type; - + for (type = DT_NONE; types[type].machine; type++) if (!strcmp (types[type].machine, s)) return type; - + return DT_NONE; } @@ -401,17 +401,17 @@ static void handle_confline (char *s, FILE *out) char buff[BUFFSIZE]; char tmp[BUFFSIZE]; int type; - + char val[BUFFSIZE]; /* xxx - put this into an actual state machine? */ /* variable name */ if (!(s = get_token (varname, sizeof (varname), s))) return; - + /* comma */ if (!(s = get_token (buff, sizeof (buff), s))) return; - + /* type */ if (!(s = get_token (buff, sizeof (buff), s))) return; @@ -429,7 +429,7 @@ static void handle_confline (char *s, FILE *out) } /* redraw, comma */ - + while (1) { if (!(s = get_token (buff, sizeof (buff), s))) return; @@ -446,7 +446,7 @@ static void handle_confline (char *s, FILE *out) if (!(s = get_token (buff, sizeof (buff), s))) return; if (Debug) fprintf (stderr, "%s: Expecting default value.\n", Progname); - + /* or UL */ if (!(s = get_token (buff, sizeof (buff), s))) return; if (!strcmp (buff, "UL")) @@ -457,7 +457,7 @@ static void handle_confline (char *s, FILE *out) memset (tmp, 0, sizeof (tmp)); - do + do { if (!strcmp (buff, "}")) break; @@ -478,7 +478,7 @@ static void pretty_default (char *t, size_t l, const char *s, int type) switch (type) { case DT_QUAD: - { + { if (!strcasecmp (s, "MUTT_YES")) strncpy (t, "yes", l); else if (!strcasecmp (s, "MUTT_NO")) strncpy (t, "no", l); else if (!strcasecmp (s, "MUTT_ASKYES")) strncpy (t, "ask-yes", l); @@ -575,7 +575,7 @@ static void man_print_strval (const char *v, FILE *out) conf_char_to_escape ((unsigned int) *v, out); continue; } - + if (*v == '"') fputs ("\"", out); else if (*v == '\\') @@ -650,7 +650,7 @@ static int sgml_id_fputs (const char *s, FILE* out) static void print_confline (const char *varname, int type, const char *val, FILE *out) { if (type == DT_SYN) return; - + switch (OutputFormat) { /* configuration file */ @@ -665,7 +665,7 @@ static void print_confline (const char *varname, int type, const char *val, FILE } else if (type != DT_SYN) fprintf (out, "\n# set %s=%s", varname, val); - + fprintf (out, "\n#\n# Name: %s", varname); fprintf (out, "\n# Type: %s", type2human (type)); if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH || @@ -705,7 +705,7 @@ static void print_confline (const char *varname, int type, const char *val, FILE break; } - + /* SGML based manual */ case F_SGML: { @@ -715,7 +715,7 @@ static void print_confline (const char *varname, int type, const char *val, FILE sgml_fputs (varname, out); fprintf (out, "\nType: %s", type2human (type)); - + if (type == DT_STR || type == DT_RX || type == DT_ADDR || type == DT_PATH || type == DT_MBCHARTBL) { @@ -744,11 +744,11 @@ static void print_confline (const char *varname, int type, const char *val, FILE /** ** Documentation line parser ** - ** The following code parses specially formatted documentation + ** The following code parses specially formatted documentation ** comments in init.h. ** ** The format is very remotely inspired by nroff. Most important, it's - ** easy to parse and convert, and it was easy to generate from the SGML + ** easy to parse and convert, and it was easy to generate from the SGML ** source of mutt's original manual. ** ** - \fI switches to italics @@ -810,7 +810,7 @@ static int flush_doc (int docstat, FILE *out) static int print_it (int special, char *str, FILE *out, int docstat) { int onl = docstat & (D_NL|D_NP); - + docstat &= ~(D_NL|D_NP|D_INIT); switch (OutputFormat) @@ -826,7 +826,7 @@ static int print_it (int special, char *str, FILE *out, int docstat) case SP_START_BF: docstat |= D_BF; break; case SP_START_EM: docstat |= D_EM; break; case SP_START_TT: docstat |= D_TT; break; - case SP_NEWLINE: + case SP_NEWLINE: { if (onl) docstat |= onl; @@ -853,9 +853,9 @@ static int print_it (int special, char *str, FILE *out, int docstat) docstat |= D_NP; break; } - case SP_START_TAB: + case SP_START_TAB: { - if (!onl) + if (!onl) fputs ("\n# ", out); docstat |= D_TAB; break; @@ -910,7 +910,7 @@ static int print_it (int special, char *str, FILE *out, int docstat) } fputs (str, out); if (docstat & D_DT) - { + { int i; for (i = strlen (str) ; i < 8 ; i++) @@ -929,13 +929,13 @@ static int print_it (int special, char *str, FILE *out, int docstat) { switch (special) { - case SP_END_FT: + case SP_END_FT: { fputs ("\\fP", out); docstat &= ~(D_EM|D_BF|D_TT); break; } - case SP_START_BF: + case SP_START_BF: { fputs ("\\fB", out); docstat |= D_BF; @@ -1069,7 +1069,7 @@ static int print_it (int special, char *str, FILE *out, int docstat) { switch (special) { - case SP_END_FT: + case SP_END_FT: { if (docstat & D_EM) fputs ("", out); if (docstat & D_BF) fputs ("", out); @@ -1077,7 +1077,7 @@ static int print_it (int special, char *str, FILE *out, int docstat) docstat &= ~(D_EM|D_BF|D_TT); break; } - case SP_START_BF: + case SP_START_BF: { fputs ("", out); docstat |= D_BF; @@ -1298,7 +1298,7 @@ static int handle_docline (char *l, FILE *out, int docstat) if (Debug) fprintf (stderr, "%s: handle_docline `%s'\n", Progname, l); - + if (!strncmp (l, ".pp", 3)) return print_it (SP_NEWPAR, NULL, out, docstat); else if (!strncmp (l, ".ts", 3)) diff --git a/doc/mutt-1.7.0-syntax.vim b/doc/mutt-1.7.0-syntax.vim index e4395fdf5..36ec3457f 100644 --- a/doc/mutt-1.7.0-syntax.vim +++ b/doc/mutt-1.7.0-syntax.vim @@ -101,7 +101,7 @@ syn match muttrcKeyName contained "\\[trne]" syn match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" syn match muttrcKeyName contained "" -syn keyword muttrcVarBool skipwhite contained +syn keyword muttrcVarBool skipwhite contained \ allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split \ auto_tag autoedit beep beep_new bounce_delivered braille_friendly \ check_mbox_size check_new collapse_unread confirmappend confirmcreate @@ -138,7 +138,7 @@ syn keyword muttrcVarBool skipwhite contained \ use_idn use_ipv6 user_agent wait_key weed wrap_search write_bcc \ nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained +syn keyword muttrcVarBool skipwhite contained \ noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc noattach_split \ noauto_tag noautoedit nobeep nobeep_new nobounce_delivered nobraille_friendly \ nocheck_mbox_size nocheck_new nocollapse_unread noconfirmappend noconfirmcreate @@ -298,12 +298,12 @@ syn match muttrcFolderFormatConditionals contained /%?[N]?/ " The following info was pulled from mix_entry_fmt in remailer.c syn match muttrcMixFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ncsa%]/ syn match muttrcMixFormatConditionals contained /%?[ncsa]?/ -" The following info was pulled from crypt_entry_fmt in crypt-gpgme.c -" and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports +" The following info was pulled from crypt_entry_fmt in crypt-gpgme.c +" and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports " 'p', but pgp_entry_fmt does not). syn match muttrcPGPFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[nkualfctp%]/ syn match muttrcPGPFormatConditionals contained /%?[nkualfct]?/ -" The following info was pulled from _mutt_fmt_pgp_command in +" The following info was pulled from _mutt_fmt_pgp_command in " pgpinvoke.c syn match muttrcPGPCmdFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[pfsar%]/ syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrcFormatConditionals2 @@ -311,11 +311,11 @@ syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrc syn match muttrcStatusFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[bdfFhlLmMnopPrsStuvV%]/ syn match muttrcStatusFormatEscapes contained /%[>|*]./ syn match muttrcStatusFormatConditionals contained /%?[bdFlLmMnoptuV]?/ nextgroup=muttrcFormatConditionals2 -" This matches the documentation, but directly contradicts the code -" (according to the code, this should be identical to the +" This matches the documentation, but directly contradicts the code +" (according to the code, this should be identical to the " muttrcPGPCmdFormatEscapes syn match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[r%]/ -" The following info was pulled from _mutt_fmt_smime_command in +" The following info was pulled from _mutt_fmt_smime_command in " smime.c syn match muttrcSmimeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[Cciskaf%]/ syn match muttrcSmimeFormatConditionals contained /%?[Cciskaf]?/ nextgroup=muttrcFormatConditionals2 diff --git a/doc/mutt.man b/doc/mutt.man index 07404a17b..c112fbec2 100644 --- a/doc/mutt.man +++ b/doc/mutt.man @@ -2,17 +2,17 @@ .\" .\" .\" Copyright (C) 1996-2016 Michael R. Elkins -.\" +.\" .\" 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. @@ -26,9 +26,9 @@ mutt \- The Mutt Mail User Agent [\-GnRyzZ] [\-e \fIcmd\fP] [\-F \fIfile\fP] [\-g \fIserver\fP] [\-m \fItype\fP] [\-f \fIfile\fP] .PP -.B mutt -[\-Enx] -[\-e \fIcmd\fP] +.B mutt +[\-Enx] +[\-e \fIcmd\fP] [\-F \fIfile\fP] [\-H \fIfile\fP] [\-i \fIfile\fP] @@ -38,9 +38,9 @@ mutt \- The Mutt Mail User Agent [\-a \fIfile\fP [...] \-\-] \fIaddr|mailto_url\fP [...] .PP -.B mutt -[\-nx] -[\-e \fIcmd\fP] +.B mutt +[\-nx] +[\-e \fIcmd\fP] [\-F \fIfile\fP] [\-s \fIsubj\fP] [\-b \fIaddr\fP] @@ -58,10 +58,10 @@ mutt \- The Mutt Mail User Agent .B mutt [\-n] [\-e \fIcmd\fP] [\-F \fIfile\fP] \-Q \fIquery\fP .PP -.B mutt +.B mutt \-v[v] .PP -.B mutt +.B mutt \-D [\-S] .SH DESCRIPTION .PP diff --git a/doc/mutt.pwl b/doc/mutt.pwl index 640aba1a5..6a1d003b9 100644 --- a/doc/mutt.pwl +++ b/doc/mutt.pwl @@ -1,4 +1,4 @@ -personal_ws-1.1 en 515 +personal_ws-1.1 en 515 unconvertable fIask fPcollapsed diff --git a/doc/muttrc.man.head b/doc/muttrc.man.head index b41e2c33b..e7fbae6b6 100644 --- a/doc/muttrc.man.head +++ b/doc/muttrc.man.head @@ -3,17 +3,17 @@ .\" .\" Copyright (C) 1996-2000 Michael R. Elkins .\" Copyright (C) 1999-2000 Thomas Roessler -.\" +.\" .\" 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. @@ -142,11 +142,11 @@ as an argument. .IP This commands permits you to specify that mutt should automatically convert the given MIME types to text/plain when displaying messages. -For this to work, there must be a +For this to work, there must be a .BR mailcap (5) -entry for the given MIME type with the +entry for the given MIME type with the .B copiousoutput -flag set. A subtype of \(lq\fB*\fP\(rq +flag set. A subtype of \(lq\fB*\fP\(rq matches any subtype, as does an empty subtype. .PP .nf @@ -156,7 +156,7 @@ matches any subtype, as does an empty subtype. .IP This command permits you to define a list of "data" MIME content types for which mutt will try to determine the actual file type from -the file name, and not use a +the file name, and not use a .BR mailcap (5) entry given for the original MIME type. For instance, you may add the \fBapplication/octet-stream\fP MIME type to this list. @@ -167,9 +167,9 @@ to the given \fIfunction\fP. Multiple maps may be specified by separating them with commas (no whitespace is allowed). .IP Valid maps are: -.BR generic ", " alias ", " attach ", " +.BR generic ", " alias ", " attach ", " .BR browser ", " editor ", " -.BR index ", " compose ", " +.BR index ", " compose ", " .BR pager ", " pgp ", " postpone ", " .BR mix . .IP @@ -188,9 +188,9 @@ name not known to mutt. .TP \fBiconv-hook\fP \fIcharset\fP \fIlocal-charset\fP This command defines a system-specific name for a character set. -This is useful when your system's +This is useful when your system's .BR iconv (3) -implementation does not understand MIME character set names (such as +implementation does not understand MIME character set names (such as .BR iso-8859-1 ), but instead insists on being fed with implementation-specific character set names (such as @@ -266,7 +266,7 @@ Valid colors include: .IP For terminals which don't support color, you can still assign attributes to objects. Valid attributes include: -.BR none ", " bold ", " underline ", " +.BR none ", " bold ", " underline ", " .BR reverse ", and " standout . .TP [\fBun\fP]\fBignore\fP \fIpattern\fP [ \fIpattern\fP ... ] @@ -684,10 +684,10 @@ characters .BR m , .BR w ", or" .BR d , -specifying a unit of years, months, weeks, or days. +specifying a unit of years, months, weeks, or days. .B + increases the maximum date matched by the given interval of time, -.B - +.B - decreases the minimum date matched by the given interval of time, and .B * increases the maximum date and decreases the minimum date matched by @@ -709,7 +709,7 @@ characters .B > matches dates which are older than the specified amount of time, an offset which begins with the character -.B < +.B < matches dates which are more recent than the specified amount of time, and an offset which begins with the character .B = diff --git a/doc/patch-notes.txt b/doc/patch-notes.txt index d4ceb0361..1c93cd520 100644 --- a/doc/patch-notes.txt +++ b/doc/patch-notes.txt @@ -9,26 +9,26 @@ Status: RO Content-Length: 1273 Lines: 34 -You folks have convinced me that the old patchlist was almost the +You folks have convinced me that the old patchlist was almost the right way to go for mutt identifying what patches have been applied. -Thus, I've implemented this scheme (and will commit it to the CVS -in a moment): There's a new file called PATCHES in the source tree, +Thus, I've implemented this scheme (and will commit it to the CVS +in a moment): There's a new file called PATCHES in the source tree, which will be empty in the official distribution. -This file's format is one patch ID per line. Patch IDs should be -the same as the file names used for distributing patches. The -format for these file names should be this: +This file's format is one patch ID per line. Patch IDs should be +the same as the file names used for distributing patches. The +format for these file names should be this: patch-... -That is, Vsevolod's NNTP patch for mutt-1.3.42 could be named like +That is, Vsevolod's NNTP patch for mutt-1.3.42 could be named like this: patch-1.3.42.vvv.nntp.1 - From PATCHES, patchlist.c will be automatically generated. In -order to properly construct PATCHES, please include the following + From PATCHES, patchlist.c will be automatically generated. In +order to properly construct PATCHES, please include the following chunk with your patch, replacing by your patch ID. ------------------------------snip------------------------------ @@ -38,9 +38,9 @@ chunk with your patch, replacing by your patch ID. + ------------------------------snip------------------------------ -The patch IDs will be displayed when mutt is run with the 'v' +The patch IDs will be displayed when mutt is run with the 'v' command line switch. --- +-- Thomas Roessler http://log.does-not-exist.org/ diff --git a/dotlock.c b/dotlock.c index f1e6aeaeb..157a7b21e 100644 --- a/dotlock.c +++ b/dotlock.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 1998-2001,2007 Thomas Roessler - * + * * 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 module either be compiled into Mutt, or it can be @@ -136,13 +136,13 @@ int main (int argc, char **argv) char *p; /* first, drop privileges */ - + if (dotlock_init_privs () == -1) return DL_EX_ERROR; /* determine the system's host name */ - + uname (&utsname); if ((p = strchr (utsname.nodename, '.'))) *p = '\0'; @@ -150,7 +150,7 @@ int main (int argc, char **argv) /* parse the command line options. */ DotlockFlags = 0; - + while ((i = getopt (argc, argv, "dtfupr:")) != EOF) { switch (i) @@ -164,7 +164,7 @@ int main (int argc, char **argv) case 'f': DotlockFlags |= DL_FL_FORCE; break; case 'p': DotlockFlags |= DL_FL_USEPRIV; break; case 'r': DotlockFlags |= DL_FL_RETRY; Retry = atoi (optarg); break; - + default: usage (argv[0]); } } @@ -176,15 +176,15 @@ int main (int argc, char **argv) } -/* - * Determine our effective group ID, and drop +/* + * Determine our effective group ID, and drop * privileges. - * + * * Return value: - * + * * 0 - everything went fine * -1 - we couldn't drop privileges. - * + * */ @@ -193,7 +193,7 @@ dotlock_init_privs (void) { # ifdef USE_SETGID - + UserGid = getgid (); MailGid = getegid (); @@ -204,11 +204,11 @@ dotlock_init_privs (void) return 0; } - + #else /* DL_STANDALONE */ -/* +/* * This function is intended to be invoked from within * mutt instead of mx.c's invoke_dotlock (). */ @@ -219,7 +219,7 @@ int dotlock_invoke (const char *path, int fd, int flags, int retry) int r; DotlockFlags = flags; - + if ((currdir = open (".", O_RDONLY)) == -1) return DL_EX_ERROR; @@ -227,12 +227,12 @@ int dotlock_invoke (const char *path, int fd, int flags, int retry) Retry = MAXLOCKATTEMPT; else Retry = 0; - + r = dotlock_dispatch (path, fd); - + fchdir (currdir); close (currdir); - + return r; } @@ -249,7 +249,7 @@ static int dotlock_dispatch (const char *f, int fd) * `dirname $f`. Additionally, f has been opened for * reading to verify that the user has at least read * permissions on that file. - * + * * For a more detailed explanation of all this, see the * lengthy comment below. */ @@ -269,16 +269,16 @@ static int dotlock_dispatch (const char *f, int fd) return dotlock_lock (realpath); } - + /* - * Get privileges - * + * Get privileges + * * This function re-acquires the privileges we may have * if the user told us to do so by giving the "-p" * command line option. - * + * * BEGIN_PRIVILEGES () won't return if an error occurs. - * + * */ static void @@ -298,9 +298,9 @@ BEGIN_PRIVILEGED (void) /* * Drop privileges - * + * * This function drops the group privileges we may have. - * + * * END_PRIVILEGED () won't return if an error occurs. * */ @@ -324,12 +324,12 @@ END_PRIVILEGED (void) /* * Usage information. - * + * * This function doesn't return. - * + * */ -static void +static void usage (const char *av0) { fprintf (stderr, "dotlock [NeoMutt %s%s (%s)]\n", PACKAGE_VERSION, GitVer, MUTT_VERSION); @@ -356,48 +356,48 @@ usage (const char *av0) /* * Access checking: Let's avoid to lock other users' mail * spool files if we aren't permitted to read them. - * + * * Some simple-minded access (2) checking isn't sufficient * here: The problem is that the user may give us a * deeply nested path to a file which has the same name * as the file he wants to lock, but different * permissions, say, e.g. * /tmp/lots/of/subdirs/var/spool/mail/root. - * + * * He may then try to replace /tmp/lots/of/subdirs by a * symbolic link to / after we have invoked access () to * check the file's permissions. The lockfile we'd * create or remove would then actually be * /var/spool/mail/root. - * + * * To avoid this attack, we proceed as follows: - * + * * - First, follow symbolic links a la * dotlock_deference_symlink (). - * + * * - get the result's dirname. - * + * * - chdir to this directory. If you can't, bail out. - * + * * - try to open the file in question, only using its * basename. If you can't, bail out. - * + * * - fstat that file and compare the result to a * subsequent lstat (only using the basename). If * the comparison fails, bail out. - * + * * dotlock_prepare () is invoked from main () directly * after the command line parsing has been done. * * Return values: - * + * * 0 - Everything's fine. The program's new current * directory is the contains the file to be locked. * The string pointed to by bn contains the name of * the file to be locked. - * + * * -1 - Something failed. Don't continue. - * + * * tlr, Jul 15 1998 */ @@ -411,7 +411,7 @@ dotlock_check_stats (struct stat *fsb, struct stat *lsb) if (S_ISLNK (lsb->st_mode) || S_ISLNK (fsb->st_mode)) return -1; - + if ((lsb->st_dev != fsb->st_dev) || (lsb->st_ino != fsb->st_ino) || (lsb->st_mode != fsb->st_mode) || @@ -424,7 +424,7 @@ dotlock_check_stats (struct stat *fsb, struct stat *lsb) /* something's fishy */ return -1; } - + return 0; } @@ -437,10 +437,10 @@ dotlock_prepare (char *bn, size_t l, const char *f, int _fd) char *p; int fd; int r; - + if (dotlock_deference_symlink (realpath, sizeof (realpath), f) == -1) return -1; - + if ((p = strrchr (realpath, '/'))) { *p = '\0'; @@ -455,9 +455,9 @@ dotlock_prepare (char *bn, size_t l, const char *f, int _fd) if (strlen (basename) + 1 > l) return -1; - + strfcpy (bn, basename, l); - + if (chdir (dirname) == -1) return -1; @@ -465,15 +465,15 @@ dotlock_prepare (char *bn, size_t l, const char *f, int _fd) fd = _fd; else if ((fd = open (basename, O_RDONLY)) == -1) return -1; - + r = fstat (fd, &fsb); - + if (_fd == -1) close (fd); - + if (r == -1) return -1; - + if (lstat (basename, &lsb) == -1) return -1; @@ -485,13 +485,13 @@ dotlock_prepare (char *bn, size_t l, const char *f, int _fd) /* * Expand a symbolic link. - * + * * This function expects newpath to have space for * at least _POSIX_PATH_MAX characters. * */ -static void +static void dotlock_expand_link (char *newpath, const char *path, const char *link) { const char *lb = NULL; @@ -519,7 +519,7 @@ dotlock_expand_link (char *newpath, const char *path, const char *link) /* * Deference a chain of symbolic links - * + * * The final path is written to d. * */ @@ -531,7 +531,7 @@ dotlock_deference_symlink (char *d, size_t l, const char *path) char realpath[_POSIX_PATH_MAX]; const char *pathptr = path; int count = 0; - + while (count++ < MAXLINKS) { if (lstat (pathptr, &sb) == -1) @@ -539,7 +539,7 @@ dotlock_deference_symlink (char *d, size_t l, const char *path) /* perror (pathptr); */ return -1; } - + if (S_ISLNK (sb.st_mode)) { char linkfile[_POSIX_PATH_MAX]; @@ -551,7 +551,7 @@ dotlock_deference_symlink (char *d, size_t l, const char *path) /* perror (pathptr); */ return -1; } - + linkfile[len] = '\0'; dotlock_expand_link (linkpath, pathptr, linkfile); strfcpy (realpath, linkpath, sizeof (realpath)); @@ -567,11 +567,11 @@ dotlock_deference_symlink (char *d, size_t l, const char *path) /* * Dotlock a file. - * + * * realpath is assumed _not_ to be an absolute path to * the file we are about to lock. Invoke * dotlock_prepare () before using this function! - * + * */ #define HARDMAXATTEMPTS 10 @@ -587,7 +587,7 @@ dotlock_lock (const char *realpath) int hard_count = 0; struct stat sb; time_t t; - + snprintf (nfslockfile, sizeof (nfslockfile), "%s.%s.%d", realpath, #ifdef DL_STANDALONE @@ -598,7 +598,7 @@ dotlock_lock (const char *realpath) (int) getpid ()); snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); - + BEGIN_PRIVILEGED (); unlink (nfslockfile); @@ -607,22 +607,22 @@ dotlock_lock (const char *realpath) { END_PRIVILEGED (); - + if (errno != EAGAIN) { /* perror ("cannot open NFS lock file"); */ return DL_EX_ERROR; } - + BEGIN_PRIVILEGED (); } END_PRIVILEGED (); - + close (fd); - + while (hard_count++ < HARDMAXATTEMPTS) { @@ -661,13 +661,13 @@ dotlock_lock (const char *realpath) return DL_EX_EXIST; } } - + prev_size = sb.st_size; - + /* don't trust sleep (3) as it may be interrupted - * by users sending signals. + * by users sending signals. */ - + t = time (NULL); do { sleep (1); @@ -683,10 +683,10 @@ dotlock_lock (const char *realpath) /* - * Unlock a file. - * + * Unlock a file. + * * The same comment as for dotlock_lock () applies here. - * + * */ static int @@ -697,14 +697,14 @@ dotlock_unlock (const char *realpath) snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); - + BEGIN_PRIVILEGED (); i = unlink (lockfile); END_PRIVILEGED (); - + if (i == -1) return DL_EX_ERROR; - + return DL_EX_OK; } @@ -730,9 +730,9 @@ dotlock_unlink (const char *realpath) /* * Check if a file can be locked at all. - * + * * The same comment as for dotlock_lock () applies here. - * + * */ static int diff --git a/dotlock.h b/dotlock.h index 240da6307..9c89a4e16 100644 --- a/dotlock.h +++ b/dotlock.h @@ -1,30 +1,30 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 1998-2000 Thomas Roessler - * + * * 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. - */ + */ #ifndef _DOTLOCK_H #define _DOTLOCK_H /* exit values */ -#define DL_EX_OK 0 -#define DL_EX_ERROR 1 -#define DL_EX_EXIST 3 +#define DL_EX_OK 0 +#define DL_EX_ERROR 1 +#define DL_EX_EXIST 3 #define DL_EX_NEED_PRIVS 4 #define DL_EX_IMPOSSIBLE 5 diff --git a/edit.c b/edit.c index 38e1b542f..886a900e8 100644 --- a/edit.c +++ b/edit.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ /* Close approximation of the mailx(1) builtin editor for sending mail. */ @@ -100,7 +100,7 @@ be_snarf_file (const char *path, char **buf, int *max, int *len, int verbose) FILE *f; char tmp[LONG_STRING]; struct stat sb; - + if ((f = fopen (path, "r"))) { fstat (fileno (f), &sb); @@ -124,7 +124,7 @@ static int be_barf_file (const char *path, char **buf, int buflen) { FILE *f; int i; - + if ((f = fopen (path, "w")) == NULL) /* __FOPEN_CHECKED__ */ { addstr (strerror (errno)); @@ -324,7 +324,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) int done = 0; int i; char *p; - + scrollok (stdscr, true); be_edit_header (msg->env, 0); @@ -484,7 +484,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) safe_realloc (&buf, sizeof (char *) * (bufmax += 25)); buf[buflen++] = safe_strdup (tmp[1] == '~' ? tmp + 1 : tmp); } - + tmp[0] = 0; } diff --git a/editmsg.c b/editmsg.c index 356810a00..2db86835c 100644 --- a/editmsg.c +++ b/editmsg.c @@ -1,23 +1,23 @@ /* * Copyright (C) 1999-2002 Thomas Roessler - * + * * 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. - */ + */ /* simple, editor-based message editing */ @@ -37,7 +37,7 @@ /* * return value: - * + * * 1 message not modified * 0 message edited successfully * -1 error @@ -55,7 +55,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) unsigned short o_old; int of, cf; - + CONTEXT tmpctx; MESSAGE *msg; @@ -63,7 +63,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) struct stat sb; time_t mtime = 0; - + mutt_mktemp (tmp, sizeof (tmp)); omagic = DefaultMagic; @@ -121,7 +121,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) mutt_error (_("Can't stat %s: %s"), tmp, strerror (errno)); goto bail; } - + if (sb.st_size == 0) { mutt_message (_("Message file is empty!")); @@ -153,7 +153,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) of = 0; cf = ((tmpctx.magic == MUTT_MBOX || tmpctx.magic == MUTT_MMDF) ? 0 : CH_NOSTATUS); - + if (fgets (buff, sizeof (buff), fp) && is_from (buff, NULL, 0, NULL)) { if (tmpctx.magic == MUTT_MBOX || tmpctx.magic == MUTT_MMDF) @@ -162,7 +162,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) else of = MUTT_ADD_FROM; - /* + /* * XXX - we have to play games with the message flags to avoid * problematic behavior with maildir folders. * @@ -188,9 +188,9 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) rc = mx_commit_message (msg, &tmpctx); mx_close_message (&tmpctx, &msg); - + mx_close_mailbox (&tmpctx, NULL); - + bail: if (fp) safe_fclose (&fp); @@ -209,7 +209,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) else if (rc == -1) mutt_message (_("Error. Preserving temporary file: %s"), tmp); - + return rc; } @@ -220,7 +220,7 @@ int mutt_edit_message (CONTEXT *ctx, HEADER *hdr) if (hdr) return edit_one_message (ctx, hdr); - + for (i = 0; i < ctx->vcount; i++) { j = ctx->v2r[i]; diff --git a/enter.c b/enter.c index 6b44e9c28..bd14f584c 100644 --- a/enter.c +++ b/enter.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2007,2011,2013 Michael R. Elkins * Copyright (C) 2000-2001 Edmund Grimley Evans - * + * * 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" @@ -78,7 +78,7 @@ static size_t width_ceiling (const wchar_t *s, size_t n, int w1) for (; n; s++, n--) if ((w += my_wcwidth (*s)) > w1) break; - return s - s0; + return s - s0; } static void my_wcstombs (char *dest, size_t dlen, const wchar_t *src, size_t slen) @@ -129,7 +129,7 @@ static size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *bu size_t wbuflen; wbuf = *pwbuf, wbuflen = *pwbuflen; - + while (*buf) { memset (&st, 0, sizeof (st)); @@ -145,7 +145,7 @@ static size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *bu } if (*buf && (k == (size_t) -1 || k == (size_t) -2)) { - if (i >= wbuflen) + if (i >= wbuflen) { wbuflen = i + 20; safe_realloc (&wbuf, wbuflen * sizeof (*wbuf)); @@ -237,7 +237,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, int rv = 0; memset (&mbstate, 0, sizeof (mbstate)); - + if (state->wbuf) { /* Coming back after return 1 */ @@ -264,9 +264,9 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, hclass = HC_COMMAND; else if (flags & MUTT_PATTERN) hclass = HC_PATTERN; - else + else hclass = HC_OTHER; - + for (;;) { if (redraw && !pass) @@ -276,7 +276,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, /* Go to end of line */ state->curpos = state->lastchar; state->begin = width_ceiling (state->wbuf, state->lastchar, my_wcswidth (state->wbuf, state->lastchar) - width + 1); - } + } if (state->curpos < state->begin || my_wcswidth (state->wbuf + state->begin, state->curpos - state->begin) >= width) state->begin = width_ceiling (state->wbuf, state->lastchar, my_wcswidth (state->wbuf, state->curpos) - width / 2); @@ -297,7 +297,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, if ((ch = km_dokey (MENU_EDITOR)) == -1) { - rv = -1; + rv = -1; goto bye; } @@ -535,7 +535,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, set_option (OPTNEEDREDRAW); if (*buf) replace_part (state, i, buf); - rv = 1; + rv = 1; goto bye; } if (!mutt_complete (buf, buflen)) @@ -551,7 +551,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, else if (flags & MUTT_ALIAS && ch == OP_EDITOR_COMPLETE) { /* invoke the alias-menu to get more addresses */ - for (i = state->curpos; i && state->wbuf[i-1] != ',' && + for (i = state->curpos; i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':'; i--) ; for (; i < state->lastchar && state->wbuf[i] == ' '; i++) @@ -568,7 +568,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, } else if (flags & MUTT_LABEL && ch == OP_EDITOR_COMPLETE) { - for (i = state->curpos; i && state->wbuf[i-1] != ',' && + for (i = state->curpos; i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':'; i--) ; for (; i < state->lastchar && state->wbuf[i] == ' '; i++) @@ -617,7 +617,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, mutt_query_complete (buf, buflen); replace_part (state, i, buf); - rv = 1; + rv = 1; goto bye; } else if (flags & MUTT_COMMAND) @@ -639,8 +639,8 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, if ((!tempbuf && !state->lastchar) || (tempbuf && templen == state->lastchar && !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t)))) { - _mutt_select_file (buf, buflen, - ((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | (multiple ? MUTT_SEL_MULTI : 0), + _mutt_select_file (buf, buflen, + ((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | (multiple ? MUTT_SEL_MULTI : 0), files, numfiles); set_option (OPTNEEDREDRAW); if (*buf) @@ -728,7 +728,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, } else { - + self_insert: state->tabs = 0; @@ -778,7 +778,7 @@ self_insert: tfiles[0] = safe_strdup (buf); *files = tfiles; } - rv = 0; + rv = 0; goto bye; } else if (wc && (wc < ' ' || IsWPrint (wc))) /* why? */ @@ -799,9 +799,9 @@ self_insert: } } } - + bye: - + mutt_reset_history_state (hclass); FREE (&tempbuf); return rv; @@ -810,7 +810,7 @@ self_insert: void mutt_free_enter_state (ENTER_STATE **esp) { if (!esp) return; - + FREE (&(*esp)->wbuf); FREE (esp); /* __FREE_CHECKED__ */ } diff --git a/extlib.c b/extlib.c index a8f467dbf..922d622b9 100644 --- a/extlib.c +++ b/extlib.c @@ -1,25 +1,25 @@ /* * Copyright (C) 1999-2000 Thomas Roessler - * + * * 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. - */ + */ -/* +/* * Some simple dummies, so we can reuse the routines from * lib.c in external programs. */ diff --git a/filter.c b/filter.c index 71a6b387e..8ffdcdc4d 100644 --- a/filter.c +++ b/filter.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins. - * + * * 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" @@ -138,7 +138,7 @@ mutt_create_filter_fd (const char *cmd, FILE **in, FILE **out, FILE **err, close (pin[0]); close (pin[1]); } - + if (out) { close (pout[0]); @@ -183,10 +183,10 @@ pid_t mutt_create_filter (const char *s, FILE **in, FILE **out, FILE **err) int mutt_wait_filter (pid_t pid) { int rc; - + waitpid (pid, &rc, 0); mutt_unblock_signals_system (1); rc = WIFEXITED (rc) ? WEXITSTATUS (rc) : -1; - + return rc; } diff --git a/filter.h b/filter.h index 3ff902e91..a651dd3a0 100644 --- a/filter.h +++ b/filter.h @@ -3,12 +3,12 @@ * 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. diff --git a/flags.c b/flags.c index b1a141fb3..d79a785da 100644 --- a/flags.c +++ b/flags.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" @@ -72,19 +72,19 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx) if (upd_ctx) ctx->deleted--; #ifdef USE_IMAP /* see my comment above */ - if (ctx->magic == MUTT_IMAP) + if (ctx->magic == MUTT_IMAP) { h->changed = 1; if (upd_ctx) ctx->changed = 1; } #endif - /* + /* * If the user undeletes a message which is marked as * "trash" in the maildir folder on disk, the folder has * been changed, and is marked accordingly. However, we do * _not_ mark the message itself changed, because trashing * is checked in specific code in the maildir folder - * driver. + * driver. */ if (ctx->magic == MUTT_MAILDIR && upd_ctx && h->trash) ctx->changed = 1; @@ -299,7 +299,7 @@ void mutt_tag_set_flag (int flag, int bf) int mutt_thread_set_flag (HEADER *hdr, int flag, int bf, int subthread) { THREAD *start, *cur = hdr->thread; - + if ((Sort & SORT_MASK) != SORT_THREADS) { mutt_error (_("Threading is not enabled.")); @@ -310,7 +310,7 @@ int mutt_thread_set_flag (HEADER *hdr, int flag, int bf, int subthread) while (cur->parent) cur = cur->parent; start = cur; - + if (cur->message) mutt_set_flag (Context, cur->message, flag, bf); @@ -326,7 +326,7 @@ int mutt_thread_set_flag (HEADER *hdr, int flag, int bf, int subthread) cur = cur->child; else if (cur->next) cur = cur->next; - else + else { while (!cur->next) { diff --git a/from.c b/from.c index ef422f1b1..340c17a25 100644 --- a/from.c +++ b/from.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2013 Michael R. Elkins - * + * * 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" @@ -88,7 +88,7 @@ int is_from (const char *s, char *path, size_t pathlen, time_t *tp) { if (*p == '\\') { - if (*++p == '\0') + if (*++p == '\0') return 0; } else if (*p == '"') @@ -110,7 +110,7 @@ int is_from (const char *s, char *path, size_t pathlen, time_t *tp) return 0; } } - + if (path) { len = (size_t) (p - s); @@ -120,7 +120,7 @@ int is_from (const char *s, char *path, size_t pathlen, time_t *tp) path[len] = 0; mutt_debug (3, "is_from(): got return path: %s\n", path); } - + s = p + 1; SKIPWS (s); if (!*s) @@ -188,7 +188,7 @@ int is_from (const char *s, char *path, size_t pathlen, time_t *tp) /* year */ if (sscanf (s, "%d", &yr) != 1) return 0; tm.tm_year = yr > 1900 ? yr - 1900 : (yr < 70 ? yr + 100 : yr); - + mutt_debug (3, "is_from(): month=%d, day=%d, hr=%d, min=%d, sec=%d, yr=%d.\n", tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year); diff --git a/globals.h b/globals.h index f9f915027..994340a6b 100644 --- a/globals.h +++ b/globals.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2010,2016 Michael R. Elkins - * + * * 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. - */ + */ WHERE void (*mutt_error) (const char *, ...); WHERE void (*mutt_message) (const char *, ...); @@ -343,7 +343,7 @@ extern const char * const Months[]; #endif #ifdef MAIN_C -/* so that global vars get included */ +/* so that global vars get included */ #include "mx.h" #include "mutt_regex.h" #include "buffy.h" diff --git a/gnupgparse.c b/gnupgparse.c index d087e3ed6..20ddc8ac6 100644 --- a/gnupgparse.c +++ b/gnupgparse.c @@ -22,12 +22,12 @@ /* * NOTE - * + * * This code used to be the parser for GnuPG's output. - * - * Nowadays, we are using an external pubring lister with PGP which mimics + * + * Nowadays, we are using an external pubring lister with PGP which mimics * gpg's output format. - * + * */ #if HAVE_CONFIG_H @@ -330,7 +330,7 @@ static pgp_key_t parse_pub_line (char *buf, int *is_subkey, pgp_key_t k) break; case 12: /* key capabilities */ mutt_debug (2, "capabilities info: %s\n", p); - + while(*p) { switch(*p++) @@ -349,7 +349,7 @@ static pgp_key_t parse_pub_line (char *buf, int *is_subkey, pgp_key_t k) } } - if (!is_uid && + if (!is_uid && (!*is_subkey || !option (OPTPGPIGNORESUB) || !((flags & KEYFLAG_DISABLED) || (flags & KEYFLAG_REVOKED) @@ -357,7 +357,7 @@ static pgp_key_t parse_pub_line (char *buf, int *is_subkey, pgp_key_t k) tmp.flags |= flags; break; - + default: break; } @@ -395,7 +395,7 @@ pgp_key_t pgp_get_candidates (pgp_ring_t keyring, LIST * hints) return NULL; mutt_str_replace (&_chs, Charset); - + thepid = pgp_invoke_list_keys (NULL, &fp, NULL, -1, -1, devnull, keyring, hints); if (thepid == -1) @@ -421,7 +421,7 @@ pgp_key_t pgp_get_candidates (pgp_ring_t keyring, LIST * hints) if (is_sub) { pgp_uid_t **l; - + k->flags |= KEYFLAG_SUBKEY; k->parent = mainkey; for (l = &k->address; *l; l = &(*l)->next) @@ -440,7 +440,7 @@ pgp_key_t pgp_get_candidates (pgp_ring_t keyring, LIST * hints) mutt_wait_filter (thepid); close (devnull); - + return db; } diff --git a/handler.c b/handler.c index 08e03ee90..096edfba7 100644 --- a/handler.c +++ b/handler.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2002,2010,2013 Michael R. Elkins - * + * * 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" @@ -152,7 +152,7 @@ static void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd) c = ch; len--; } - else + else ungetc(ch, s->fpin); } @@ -175,7 +175,7 @@ static int qp_decode_triple (char *s, char *d) /* soft line break */ if (*s == '=' && !(*(s+1))) return 1; - + /* quoted-printable triple */ if (*s == '=' && isxdigit ((unsigned char) *(s+1)) && @@ -184,7 +184,7 @@ static int qp_decode_triple (char *s, char *d) *d = (hexval (*(s+1)) << 4) | hexval (*(s+2)); return 0; } - + /* something else */ return -1; } @@ -199,7 +199,7 @@ static void qp_decode_line (char *dest, char *src, size_t *l, int soft = 0; /* decode the line */ - + for (d = dest, s = src; *s;) { switch ((kind = qp_decode_triple (s, &c))) @@ -220,33 +220,33 @@ static void qp_decode_line (char *dest, char *src, size_t *l, else *d++ = '\n'; } - + *d = '\0'; *l = d - dest; } -/* +/* * Decode an attachment encoded with quoted-printable. - * + * * Why doesn't this overflow any buffers? First, it's guaranteed * that the length of a line grows when you _en_-code it to * quoted-printable. That means that we always can store the * result in a buffer of at most the _same_ size. - * + * * Now, we don't special-case if the line we read with fgets() * isn't terminated. We don't care about this, since STRING > 78, * so corrupted input will just be corrupted a bit more. That * implies that STRING+1 bytes are always sufficient to store the * result of qp_decode_line. - * + * * Finally, at soft line breaks, some part of a multibyte character * may have been left over by mutt_convert_to_state(). This shouldn't * be more than 6 characters, so STRING + 7 should be sufficient * memory to store the decoded data. - * + * * Just to make sure that I didn't make some off-by-one error * above, we just use STRING*2 for the target buffer's size. - * + * */ static void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd) @@ -256,16 +256,16 @@ static void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd) size_t l = 0; size_t linelen; /* number of input bytes in `line' */ size_t l3; - + int last; /* store the last character in the input line */ - + if (istext) state_set_prefix(s); while (len > 0) { last = 0; - + /* * It's ok to use a fixed size buffer for input, even if the line turns * out to be longer than this. Just process the line in chunks. This @@ -312,7 +312,7 @@ void mutt_decode_base64 (STATE *s, long len, int istext, iconv_t cd) buf[4] = 0; - if (istext) + if (istext) state_set_prefix(s); while (len > 0) @@ -337,11 +337,11 @@ void mutt_decode_base64 (STATE *s, long len, int istext, iconv_t cd) c2 = base64val (buf[1]); ch = (c1 << 2) | (c2 >> 4); - if (cr && ch != '\n') + if (cr && ch != '\n') bufi[l++] = '\r'; cr = 0; - + if (istext && ch == '\r') cr = 1; else @@ -374,7 +374,7 @@ void mutt_decode_base64 (STATE *s, long len, int istext, iconv_t cd) cr = 1; else bufi[l++] = ch; - + if (l + 8 >= sizeof (bufi)) mutt_convert_to_state (cd, bufi, &l, s); } @@ -404,7 +404,7 @@ static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd) if(istext) state_set_prefix(s); - + while(len > 0) { if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL) @@ -442,7 +442,7 @@ static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd) mutt_convert_to_state (cd, bufi, &k, s); mutt_convert_to_state (cd, 0, 0, s); - + state_reset_prefix(s); } @@ -451,8 +451,8 @@ static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd) */ #define IndentSize (4) - -enum { RICH_PARAM=0, RICH_BOLD, RICH_UNDERLINE, RICH_ITALIC, RICH_NOFILL, + +enum { RICH_PARAM=0, RICH_BOLD, RICH_UNDERLINE, RICH_ITALIC, RICH_NOFILL, RICH_INDENT, RICH_INDENT_RIGHT, RICH_EXCERPT, RICH_CENTER, RICH_FLUSHLEFT, RICH_FLUSHRIGHT, RICH_COLOR, RICH_LAST_TAG }; @@ -539,9 +539,9 @@ static void enriched_wrap (struct enriched_state *stte) extra = stte->WrapMargin - stte->line_len - stte->indent_len - (stte->tag_level[RICH_INDENT_RIGHT] * IndentSize); - if (extra > 0) + if (extra > 0) { - if (stte->tag_level[RICH_CENTER]) + if (stte->tag_level[RICH_CENTER]) { x = extra / 2; while (x) @@ -549,7 +549,7 @@ static void enriched_wrap (struct enriched_state *stte) state_putc (' ', stte->s); x--; } - } + } else if (stte->tag_level[RICH_FLUSHRIGHT]) { x = extra-1; @@ -577,7 +577,7 @@ static void enriched_wrap (struct enriched_state *stte) if (stte->tag_level[RICH_EXCERPT]) { x = stte->tag_level[RICH_EXCERPT]; - while (x) + while (x) { if (stte->s->prefix) { @@ -598,7 +598,7 @@ static void enriched_wrap (struct enriched_state *stte) { x = stte->tag_level[RICH_INDENT] * IndentSize; stte->indent_len += x; - while (x) + while (x) { state_putc (' ', stte->s); x--; @@ -608,8 +608,8 @@ static void enriched_wrap (struct enriched_state *stte) static void enriched_flush (struct enriched_state *stte, int wrap) { - if (!stte->tag_level[RICH_NOFILL] && (stte->line_len + stte->word_len > - (stte->WrapMargin - (stte->tag_level[RICH_INDENT_RIGHT] * IndentSize) - + if (!stte->tag_level[RICH_NOFILL] && (stte->line_len + stte->word_len > + (stte->WrapMargin - (stte->tag_level[RICH_INDENT_RIGHT] * IndentSize) - stte->indent_len))) enriched_wrap (stte); @@ -635,9 +635,9 @@ static void enriched_flush (struct enriched_state *stte, int wrap) static void enriched_putwc (wchar_t c, struct enriched_state *stte) { - if (stte->tag_level[RICH_PARAM]) + if (stte->tag_level[RICH_PARAM]) { - if (stte->tag_level[RICH_COLOR]) + if (stte->tag_level[RICH_COLOR]) { if (stte->param_used + 1 >= stte->param_len) safe_realloc (&stte->param, (stte->param_len += STRING) * sizeof (wchar_t)); @@ -660,7 +660,7 @@ static void enriched_putwc (wchar_t c, struct enriched_state *stte) stte->word_len += 8 - (stte->line_len + stte->word_len) % 8; else stte->word_len++; - + stte->buffer[stte->buff_used++] = c; enriched_flush (stte, 0); } @@ -724,7 +724,7 @@ static void enriched_set_flags (const wchar_t *tag, struct enriched_state *stte) if (*tagptr == (wchar_t) '/') tagptr++; - + for (i = 0, j = -1; EnrichedTags[i].tag_name; i++) if (wcscasecmp (EnrichedTags[i].tag_name, tagptr) == 0) { @@ -850,7 +850,7 @@ static int text_enriched_handler (BODY *a, STATE *s) { enriched_flush (&stte, 1); } - else + else { enriched_putwc ((wchar_t) ' ', &stte); state = NEWLINE; @@ -922,7 +922,7 @@ static int text_enriched_handler (BODY *a, STATE *s) FREE (&(stte.param)); return 0; -} +} /* for compatibility with metamail */ static int is_mmnoask (const char *buf) @@ -993,7 +993,7 @@ static int mutt_is_autoview (BODY *b) mutt_check_lookup_list (b, type, sizeof (type)); for (; t; t = t->next) { int i = mutt_strlen (t->data) - 1; - if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && + if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && ascii_strncasecmp (type, t->data, i) == 0) || ascii_strcasecmp (type, t->data) == 0) is_autoview = 1; @@ -1063,7 +1063,7 @@ static int alternative_handler (BODY *a, STATE *s) btlen = mutt_strlen (t->data); } - if (a && a->parts) + if (a && a->parts) b = a->parts; else b = a; @@ -1086,7 +1086,7 @@ static int alternative_handler (BODY *a, STATE *s) /* Next, look for an autoviewable type */ if (!choice) { - if (a && a->parts) + if (a && a->parts) b = a->parts; else b = a; @@ -1101,7 +1101,7 @@ static int alternative_handler (BODY *a, STATE *s) /* Then, look for a text entry */ if (!choice) { - if (a && a->parts) + if (a && a->parts) b = a->parts; else b = a; @@ -1132,7 +1132,7 @@ static int alternative_handler (BODY *a, STATE *s) /* Finally, look for other possibilities */ if (!choice) { - if (a && a->parts) + if (a && a->parts) b = a->parts; else b = a; @@ -1201,7 +1201,7 @@ static int message_handler (BODY *a, STATE *s) int rc = 0; off_start = ftello (s->fpin); - if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || + if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED) { fstat (fileno (s->fpin), &st); @@ -1229,7 +1229,7 @@ static int message_handler (BODY *a, STATE *s) if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED) mutt_free_body (&b); - + return rc; } @@ -1258,7 +1258,7 @@ int mutt_can_decode (BODY *a) if (mutt_can_decode (p)) return (1); } - + } else if (WithCrypto && a->type == TYPEAPPLICATION) { @@ -1316,14 +1316,14 @@ static int multipart_handler (BODY *a, STATE *s) rc = mutt_body_handler (p, s); state_putc ('\n', s); - + if (rc) { mutt_error (_("One or more parts of this message could not be displayed")); mutt_debug (1, "Failed on attachment #%d, type %s/%s.\n", count, TYPE(p), NONULL (p->subtype)); } - + if ((s->flags & MUTT_REPLYING) && (option (OPTINCLUDEONLYFIRST)) && (s->flags & MUTT_FIRSTDONE)) break; @@ -1382,7 +1382,7 @@ static int autoview_handler (BODY *a, STATE *s) rfc1524_free_entry (&entry); return -1; } - + mutt_copy_bytes (s->fpin, fpin, a->length); if(!piped) @@ -1410,7 +1410,7 @@ static int autoview_handler (BODY *a, STATE *s) rc = -1; goto bail; } - + if (s->prefix) { while (fgets (buffer, sizeof(buffer), fpout) != NULL) @@ -1419,7 +1419,7 @@ static int autoview_handler (BODY *a, STATE *s) state_puts (buffer, s); } /* check for data on stderr */ - if (fgets (buffer, sizeof(buffer), fperr)) + if (fgets (buffer, sizeof(buffer), fperr)) { if (s->flags & MUTT_DISPLAY) { @@ -1445,10 +1445,10 @@ static int autoview_handler (BODY *a, STATE *s) if (s->flags & MUTT_DISPLAY) { state_mark_attach (s); - state_printf (s, _("[-- Autoview stderr of %s --]\n"), + state_printf (s, _("[-- Autoview stderr of %s --]\n"), command); } - + state_puts (buffer, s); mutt_copy_stream (fperr, s->fpout); } @@ -1464,7 +1464,7 @@ static int autoview_handler (BODY *a, STATE *s) else mutt_unlink (tempfile); - if (s->flags & MUTT_DISPLAY) + if (s->flags & MUTT_DISPLAY) mutt_clear_error (); } rfc1524_free_entry (&entry); @@ -1503,7 +1503,7 @@ static int external_body_handler (BODY *b, STATE *s) { char *length; char pretty_size[10]; - + state_mark_attach (s); state_printf (s, _("[-- This %s/%s attachment "), TYPE(b->parts), b->parts->subtype); @@ -1556,7 +1556,7 @@ static int external_body_handler (BODY *b, STATE *s) _("[-- This %s/%s attachment is not included, --]\n"), TYPE (b->parts), b->parts->subtype); state_mark_attach (s); - state_printf (s, + state_printf (s, _("[-- and the indicated access-type %s is unsupported --]\n"), access_type); mutt_copy_hdr (s->fpin, s->fpout, ftello (s->fpin), b->parts->offset, @@ -1564,7 +1564,7 @@ static int external_body_handler (BODY *b, STATE *s) CH_DECODE | CH_DISPLAY, NULL); } } - + return 0; } @@ -1799,7 +1799,7 @@ int mutt_body_handler (BODY *b, STATE *s) int rc = 0; int oflags = s->flags; - + /* first determine which handler to use to process this part */ if (mutt_is_autoview (b)) diff --git a/hash.c b/hash.c index ae6d1c91a..b517d3334 100644 --- a/hash.c +++ b/hash.c @@ -5,16 +5,16 @@ * 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" @@ -144,7 +144,7 @@ HASH *hash_resize (HASH *ptr, int nelem, int lower) /* table hash table to update * key key to hash on * data data to associate with `key' - * allow_dup if nonzero, duplicate keys are allowed in the table + * allow_dup if nonzero, duplicate keys are allowed in the table */ static int union_hash_insert (HASH * table, union hash_key key, void *data) { @@ -333,7 +333,7 @@ void int_hash_delete (HASH *table, unsigned int intkey, const void *data, } /* ptr pointer to the hash table to be freed - * destroy() function to call to free the ->data member (optional) + * destroy() function to call to free the ->data member (optional) */ void hash_destroy (HASH **ptr, void (*destroy) (void *)) { @@ -381,7 +381,7 @@ struct hash_elem *hash_walk(const HASH *table, struct hash_walk_state *state) return state->last; } state->index++; - } + } state->index = 0; state->last = NULL; diff --git a/hash.h b/hash.h index e2f7ace93..955a1a1b3 100644 --- a/hash.h +++ b/hash.h @@ -5,12 +5,12 @@ * 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. diff --git a/hcache.h b/hcache.h index d669a0d54..24cae29fc 100644 --- a/hcache.h +++ b/hcache.h @@ -125,7 +125,7 @@ mutt_hcache_store(header_cache_t *h, const char *key, size_t keylen, * @return 0 on success, -1 otherwise. */ int -mutt_hcache_store_raw(header_cache_t *h, const char* key, size_t keylen, +mutt_hcache_store_raw(header_cache_t *h, const char* key, size_t keylen, void* data, size_t dlen); /** diff --git a/hdrline.c b/hdrline.c index f72cfc3be..0fc4620e7 100644 --- a/hdrline.c +++ b/hdrline.c @@ -2,21 +2,21 @@ * Copyright (C) 1996-2000,2002,2007 Michael R. Elkins * Copyright (C) 2016 Richard Russon * Copyright (C) 2016 Ian Zimmerman - * + * * 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" @@ -302,7 +302,7 @@ int mutt_user_is_recipient (HEADER *h) if(!h->recip_valid) { h->recip_valid = 1; - + if (mutt_addr_is_user (env->from)) h->recipient = 4; else if (user_in_addr (env->to)) @@ -321,7 +321,7 @@ int mutt_user_is_recipient (HEADER *h) else h->recipient = 0; } - + return h->recipient; } @@ -545,12 +545,12 @@ hdr_format_str (char *dest, else strfcpy (dest, ctx->path, destlen); } - else + else strfcpy(dest, "(null)", destlen); strfcpy (buf2, dest, sizeof(buf2)); mutt_format_s (dest, destlen, prefix, buf2); break; - + case 'c': colorlen = add_index_color (dest, destlen, flags, MT_COLOR_INDEX_SIZE); mutt_pretty_size (buf2, sizeof (buf2), (long) hdr->content->length); @@ -575,7 +575,7 @@ hdr_format_str (char *dest, /* preprocess $date_format to handle %Z */ { const char *cp; - struct tm *tm; + struct tm *tm; time_t T; int i = 0, invert = 0; @@ -683,7 +683,7 @@ hdr_format_str (char *dest, len = destlen - 1; while (len > 0 && (((op == 'd' || op == 'D') && *cp) || - (op == '{' && *cp != '}') || + (op == '{' && *cp != '}') || (op == '[' && *cp != ']') || (op == '(' && *cp != ')') || (op == '<' && *cp != '>'))) @@ -1031,7 +1031,7 @@ hdr_format_str (char *dest, break; case 'v': - if (mutt_addr_is_user (hdr->env->from)) + if (mutt_addr_is_user (hdr->env->from)) { if (hdr->env->to) mutt_format_s (buf2, sizeof (buf2), prefix, mutt_get_name (hdr->env->to)); @@ -1141,7 +1141,7 @@ hdr_format_str (char *dest, mutt_format_s (dest + colorlen, destlen - colorlen, prefix, NONULL (hdr->env->x_label)); add_index_color (dest + colorlen, destlen - colorlen, flags, MT_COLOR_INDEX); break; - + case 'Y': if (hdr->env->x_label) { diff --git a/headers.c b/headers.c index 1f671dde2..898c34f25 100644 --- a/headers.c +++ b/headers.c @@ -1,16 +1,16 @@ -/* +/* * Copyright (C) 1996-2009,2012 Michael R. Elkins - * + * * 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. @@ -51,7 +51,7 @@ void mutt_edit_headers (const char *editor, mutt_perror (path); return; } - + mutt_env_to_local (msg->env); mutt_write_rfc822_header (ofp, msg->env, NULL, 1, 0); fputc ('\n', ofp); /* tie off the header. */ @@ -95,7 +95,7 @@ void mutt_edit_headers (const char *editor, mutt_perror (path); return; } - + if ((ofp = safe_fopen (body, "w")) == NULL) { /* intentionally leak a possible temporary file here */ @@ -103,7 +103,7 @@ void mutt_edit_headers (const char *editor, mutt_perror (body); return; } - + n = mutt_read_rfc822_header (ifp, NULL, 1, 0); while ((i = fread (buffer, 1, sizeof (buffer), ifp)) > 0) fwrite (buffer, 1, i, ofp); @@ -133,7 +133,7 @@ void mutt_edit_headers (const char *editor, mutt_expand_aliases_env (msg->env); - /* search through the user defined headers added to see if + /* search through the user defined headers added to see if * fcc: or attach: or pgp: was specified */ diff --git a/help.c b/help.c index ab3d0ff40..64c9bd8f3 100644 --- a/help.c +++ b/help.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2009 Michael R. Elkins - * + * * 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. - */ + */ #define HELP_C @@ -41,7 +41,7 @@ static const struct binding_t *help_lookupFunction (int op, int menu) /* first look in the generic map for the function */ for (i = 0; OpGeneric[i].name; i++) if (OpGeneric[i].op == op) - return (&OpGeneric[i]); + return (&OpGeneric[i]); } if ((map = km_get_table(menu))) @@ -50,7 +50,7 @@ static const struct binding_t *help_lookupFunction (int op, int menu) if (map[i].op == op) return (&map[i]); } - + return (NULL); } @@ -71,7 +71,7 @@ mutt_compile_help (char *buf, size_t buflen, int menu, const struct mapping_t *i int i; size_t len; char *pbuf = buf; - + for (i = 0; items[i].name && buflen > 2; i++) { if (i) @@ -350,29 +350,29 @@ void mutt_help (int menu) desc = mutt_getnamebyvalue (menu, Menus); if (!desc) desc = _(""); - + do { if ((f = safe_fopen (t, "w")) == NULL) { mutt_perror (t); return; } - + dump_menu (f, menu); if (menu != MENU_EDITOR && menu != MENU_PAGER) { fputs (_("\nGeneric bindings:\n\n"), f); dump_menu (f, MENU_GENERIC); } - + fputs (_("\nUnbound functions:\n\n"), f); if (funcs) dump_unbound (f, funcs, Keymaps[menu], NULL); if (menu != MENU_PAGER) dump_unbound (f, OpGeneric, Keymaps[MENU_GENERIC], Keymaps[menu]); - + safe_fclose (&f); - + snprintf (buf, sizeof (buf), _("Help for %s"), desc); } while diff --git a/history.c b/history.c index e72e9fb23..74a0e3e9d 100644 --- a/history.c +++ b/history.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" @@ -28,7 +28,7 @@ struct history char **hist; short cur; short last; -}; +}; /* global vars used for the string-history routines */ @@ -50,10 +50,10 @@ static void init_history (struct history *h) FREE (&h->hist); } } - + if (HistSize) h->hist = safe_calloc (HistSize + 1, sizeof (char *)); - + h->cur = 0; h->last = 0; } @@ -209,16 +209,16 @@ static void save_history (history_class_t hclass, const char *s) void mutt_init_history(void) { history_class_t hclass; - + if (HistSize == OldSize) return; - + for(hclass = HC_FIRST; hclass < HC_LAST; hclass++) init_history(&History[hclass]); OldSize = HistSize; } - + void mutt_history_add (history_class_t hclass, const char *s, int save) { int prev; diff --git a/history.h b/history.h index 994526b63..f6ed491db 100644 --- a/history.h +++ b/history.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #ifndef _HISTORY_H #define _HISTORY_H diff --git a/hook.c b/hook.c index b70bb254b..151adc5d3 100644 --- a/hook.c +++ b/hook.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 1996-2002,2004,2007 Michael R. Elkins , and others * * This program is free software; you can redistribute it and/or modify @@ -353,7 +353,7 @@ void mutt_folder_hook (char *path) } FREE (&token.data); FREE (&err.data); - + current_hook_type = 0; } diff --git a/imap/TODO b/imap/TODO index f428a2aa1..44d0a0a3d 100644 --- a/imap/TODO +++ b/imap/TODO @@ -14,7 +14,7 @@ IMAP enhancements, by priority: * We should maybe add a new imap_format string for IMAP browsing, without all the stat variables but with tags like how many messages are in the folders, how many subfolders, that weird \Marked tag, etc. - + [ -- speed -- ] * Partial index loading, using server-side threading and sorting diff --git a/imap/auth.c b/imap/auth.c index f6a914d0c..f58488738 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -2,21 +2,21 @@ * Copyright (C) 1996-1998 Michael R. Elkins * Copyright (C) 1996-1999 Brandon Long * Copyright (C) 1999-2001 Brendan Cully - * + * * 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. - */ + */ /* IMAP login/authentication code */ @@ -69,7 +69,7 @@ int imap_authenticate (IMAP_DATA* idata) *delim++ = '\0'; if (! method[0]) continue; - + mutt_debug (2, "imap_authenticate: Trying method %s\n", method); authenticator = imap_authenticators; @@ -83,7 +83,7 @@ int imap_authenticate (IMAP_DATA* idata) FREE (&methods); return r; } - + authenticator++; } } @@ -109,6 +109,6 @@ int imap_authenticate (IMAP_DATA* idata) mutt_error (_("No authenticators available")); mutt_sleep (1); } - + return r; } diff --git a/imap/auth.h b/imap/auth.h index 3c930d8e5..d3506a813 100644 --- a/imap/auth.h +++ b/imap/auth.h @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2001 Brendan Cully - * + * * 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 defs for authenticators. A good place to set up a generic callback * system */ diff --git a/imap/auth_anon.c b/imap/auth_anon.c index 9664e49f4..168baa47a 100644 --- a/imap/auth_anon.c +++ b/imap/auth_anon.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2001,2005 Brendan Cully - * + * * 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. - */ + */ /* IMAP login/authentication code */ @@ -59,7 +59,7 @@ imap_auth_res_t imap_auth_anon (IMAP_DATA* idata, const char* method) do rc = imap_cmd_step (idata); while (rc == IMAP_CMD_CONTINUE); - + if (rc != IMAP_CMD_OK) { mutt_debug (1, "Error receiving server response.\n"); diff --git a/imap/auth_cram.c b/imap/auth_cram.c index 3ed6d5771..ee2b69628 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2001,2005 Brendan Cully - * + * * 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. - */ + */ /* IMAP login/authentication code */ @@ -64,7 +64,7 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method) do rc = imap_cmd_step (idata); while (rc == IMAP_CMD_CONTINUE); - + if (rc != IMAP_CMD_RESPOND) { mutt_debug (1, "Invalid response from server: %s\n", ibuf); @@ -85,7 +85,7 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method) * computed by applying the keyed MD5 algorithm from [KEYED-MD5] where the * key is a shared secret and the digested text is the timestamp (including * angle-brackets). - * + * * Note: The user name shouldn't be quoted. Since the digest can't contain * spaces, there is no ambiguity. Some servers get this wrong, we'll work * around them when the bug report comes in. Until then, we'll remain @@ -102,10 +102,10 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method) hmac_response[12], hmac_response[13], hmac_response[14], hmac_response[15]); mutt_debug (2, "CRAM response: %s\n", obuf); - /* XXX - ibuf must be long enough to store the base64 encoding of obuf, + /* XXX - ibuf must be long enough to store the base64 encoding of obuf, * plus the additional debris */ - + mutt_to_base64 (ibuf, obuf, strlen (obuf), sizeof (ibuf) - 2); safe_strcat (ibuf, sizeof (ibuf), "\r\n"); mutt_socket_write (idata->conn, ibuf); diff --git a/imap/auth_gss.c b/imap/auth_gss.c index 1e2c95ed0..740e1e629 100644 --- a/imap/auth_gss.c +++ b/imap/auth_gss.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2001,2005,2009 Brendan Cully - * + * * 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. - */ + */ /* GSS login/authentication code */ @@ -43,12 +43,12 @@ #define GSS_AUTH_P_PRIVACY 4 static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min) { - OM_uint32 maj_stat, min_stat; + OM_uint32 maj_stat, min_stat; OM_uint32 msg_ctx = 0; gss_buffer_desc status_string; char buf_maj[512]; char buf_min[512]; - + do { maj_stat = gss_display_status (&min_stat, @@ -61,7 +61,7 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min) break; strncpy(buf_maj, (char*) status_string.value, sizeof(buf_maj)); gss_release_buffer(&min_stat, &status_string); - + maj_stat = gss_display_status (&min_stat, err_min, GSS_C_MECH_CODE, @@ -74,7 +74,7 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min) gss_release_buffer(&min_stat, &status_string); } } while (!GSS_ERROR(maj_stat) && msg_ctx != 0); - + mutt_debug (2, "((%s:%d )(%s:%d))", buf_maj, err_maj, buf_min, err_min); } @@ -101,7 +101,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method) if (mutt_account_getuser (&idata->conn->account)) return IMAP_AUTH_FAILURE; - + /* get an IMAP service ticket for the server */ snprintf (buf1, sizeof (buf1), "imap@%s", idata->conn->account.host); request_buf.value = buf1; @@ -113,7 +113,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method) mutt_debug (2, "Couldn't get service name for [%s]\n", buf1); return IMAP_AUTH_UNAVAIL; } -#ifdef DEBUG +#ifdef DEBUG else if (debuglevel >= 2) { maj_stat = gss_display_name (&min_stat, target_name, &request_buf, @@ -128,7 +128,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method) /* build token */ maj_stat = gss_init_sec_context (&min_stat, GSS_C_NO_CREDENTIAL, &context, - target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0, + target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0, GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token, (unsigned int*) &cflags, NULL); if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) @@ -185,7 +185,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method) /* Write client data */ maj_stat = gss_init_sec_context (&min_stat, GSS_C_NO_CREDENTIAL, &context, - target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0, + target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0, GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token, (unsigned int*) &cflags, NULL); if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) diff --git a/imap/auth_login.c b/imap/auth_login.c index 223aee875..fc78730ef 100644 --- a/imap/auth_login.c +++ b/imap/auth_login.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2001,2005,2009 Brendan Cully - * + * * 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. - */ + */ /* plain LOGIN support */ @@ -60,7 +60,7 @@ imap_auth_res_t imap_auth_login (IMAP_DATA* idata, const char* method) snprintf (buf, sizeof (buf), "LOGIN %s %s", q_user, q_pass); rc = imap_exec (idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS); - + if (!rc) { mutt_clear_error(); /* clear "Logging in...". fixes #3524 */ diff --git a/imap/auth_plain.c b/imap/auth_plain.c index 1b97a2964..c2041f8d1 100644 --- a/imap/auth_plain.c +++ b/imap/auth_plain.c @@ -50,7 +50,7 @@ imap_auth_res_t imap_auth_plain(IMAP_DATA *idata, const char *method) do rc = imap_cmd_step(idata); while (rc == IMAP_CMD_CONTINUE); - + if (rc == IMAP_CMD_BAD) { res = IMAP_AUTH_UNAVAIL; diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 29756ed60..78417e433 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2006,2012 Brendan Cully - * + * * 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. - */ + */ /* SASL login/authentication code */ @@ -67,13 +67,13 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) if (mutt_bit_isset (idata->capabilities, AUTH_ANON) && (!idata->conn->account.user[0] || !ascii_strncmp (idata->conn->account.user, "anonymous", 9))) - rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, + rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen, &mech); } else if (!ascii_strcasecmp ("login", method) && !strstr (NONULL (idata->capstr), "AUTH=LOGIN")) /* do not use SASL login for regular IMAP login (#3556) */ return IMAP_AUTH_UNAVAIL; - + if (rc != SASL_OK && rc != SASL_CONTINUE) do { @@ -184,7 +184,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) goto bail; } } - + if (irc == IMAP_CMD_RESPOND) { strfcpy (buf + olen, "\r\n", bufsize - olen); @@ -197,7 +197,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) mutt_socket_write (idata->conn, "*\r\n"); mutt_debug (1, "imap_auth_sasl: sasl_client_step error %d\n", rc); } - + olen = 0; } diff --git a/imap/browse.c b/imap/browse.c index e714b7d78..e5b915906 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-1999 Brandon Long * Copyright (C) 1999-2008 Brendan Cully - * + * * 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. - */ + */ /* Mutt browser support routines */ @@ -122,7 +122,7 @@ int imap_browse (char* path, struct browser_state* state) * Note: UW-IMAP servers return folder + delimiter when asked to list * folder + delimiter. Cyrus servers don't. So we ask for folder, * and tack on delimiter ourselves. - * Further note: UW-IMAP servers return nothing when asked for + * Further note: UW-IMAP servers return nothing when asked for * NAMESPACES without delimiters at the end. Argh! */ for (n--; n >= 0 && mbox[n] != list.delim ; n--); if (n > 0) /* "aaaa/bbbb/" -> "aaaa" */ @@ -149,7 +149,7 @@ int imap_browse (char* path, struct browser_state* state) state->folder = safe_strdup (buf); } mbox[n] = ctmp; - } + } /* "/bbbb/" -> add "/", "aaaa/" -> add "" */ else { @@ -157,7 +157,7 @@ int imap_browse (char* path, struct browser_state* state) /* folder may be "/" */ snprintf (relpath, sizeof (relpath), "%c" , n < 0 ? '\0' : idata->delim); if (showparents) - imap_add_folder (idata->delim, relpath, 1, 0, state, 1); + imap_add_folder (idata->delim, relpath, 1, 0, state, 1); if (!state->folder) { imap_qualify_path (buf, sizeof (buf), &mx, relpath); @@ -222,7 +222,7 @@ int imap_mailbox_create (const char* folder) mx.account.host); goto fail; } - + strfcpy (buf, NONULL (mx.mbox), sizeof (buf)); /* append a delimiter if necessary */ @@ -232,7 +232,7 @@ int imap_mailbox_create (const char* folder) buf[n++] = idata->delim; buf[n] = '\0'; } - + if (mutt_get_field (_("Create mailbox: "), buf, sizeof (buf), MUTT_FILE) < 0) goto fail; @@ -242,7 +242,7 @@ int imap_mailbox_create (const char* folder) mutt_sleep(1); goto fail; } - + if (imap_create_mailbox (idata, buf) < 0) goto fail; @@ -285,7 +285,7 @@ int imap_mailbox_rename(const char* mailbox) snprintf(buf, sizeof (buf), _("Rename mailbox %s to: "), mx.mbox); strfcpy (newname, mx.mbox, sizeof (newname)); - + if (mutt_get_field (buf, newname, sizeof (newname), MUTT_FILE) < 0) goto fail; @@ -407,7 +407,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, relpath[strlen (relpath) + 1] = '\0'; relpath[strlen (relpath)] = delim; } - + (state->entry)[state->entrylen].desc = safe_strdup (relpath); (state->entry)[state->entrylen].imap = 1; diff --git a/imap/command.c b/imap/command.c index 7328b6834..434f82f62 100644 --- a/imap/command.c +++ b/imap/command.c @@ -2,21 +2,21 @@ * Copyright (C) 1996-1998,2010,2012 Michael R. Elkins * Copyright (C) 1996-1999 Brandon Long * Copyright (C) 1999-2009,2011 Brendan Cully - * + * * 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. - */ + */ /* command.c: routines for sending commands to an IMAP server and parsing * responses */ @@ -57,7 +57,7 @@ static const char * const Capabilities[] = { "IMAP4", "IMAP4rev1", "STATUS", - "ACL", + "ACL", "NAMESPACE", "AUTH=CRAM-MD5", "AUTH=GSSAPI", @@ -179,7 +179,7 @@ int imap_cmd_step (IMAP_DATA* idata) mutt_debug (3, "IMAP queue drained\n"); imap_cmd_finish (idata); } - + return rc; } @@ -277,7 +277,7 @@ void imap_cmd_finish (IMAP_DATA* idata) if (!(idata->state >= IMAP_SELECTED) || idata->ctx->closing) return; - + if (idata->reopen & IMAP_REOPEN_ALLOW) { int count = idata->newMailCount; @@ -332,7 +332,7 @@ int imap_cmd_idle (IMAP_DATA* idata) mutt_debug (1, "imap_cmd_idle: error starting IDLE\n"); return -1; } - + return 0; } @@ -427,7 +427,7 @@ static int cmd_start (IMAP_DATA* idata, const char* cmdstr, int flags) static int cmd_status (const char *s) { s = imap_next_word((char*)s); - + if (!ascii_strncasecmp("OK", s, 2)) return IMAP_CMD_OK; if (!ascii_strncasecmp("NO", s, 2)) @@ -631,28 +631,28 @@ static void cmd_parse_fetch (IMAP_DATA* idata, char* s) mutt_debug (3, "Handling FETCH\n"); msgno = atoi (s); - + if (msgno <= idata->ctx->msgcount) /* see cmd_parse_expunge */ for (cur = 0; cur < idata->ctx->msgcount; cur++) { h = idata->ctx->hdrs[cur]; - + if (h && h->active && h->index+1 == msgno) { mutt_debug (2, "Message UID %d updated\n", HEADER_DATA(h)->uid); break; } - + h = NULL; } - + if (!h) { mutt_debug (3, "FETCH response ignored for this message\n"); return; } - + /* skip FETCH */ s = imap_next_word (s); s = imap_next_word (s); @@ -710,7 +710,7 @@ static void cmd_parse_list (IMAP_DATA* idata, char* s) /* See draft-gahrns-imap-child-mailbox-?? */ else if (!ascii_strncasecmp (s, "\\HasNoChildren", 14)) list->noinferiors = 1; - + s = imap_next_word (s); if (*(s - 2) == ')') break; @@ -720,7 +720,7 @@ static void cmd_parse_list (IMAP_DATA* idata, char* s) if (ascii_strncasecmp (s, "NIL", 3)) { delimbuf[0] = '\0'; - safe_strcat (delimbuf, 5, s); + safe_strcat (delimbuf, 5, s); imap_unquote_string (delimbuf); list->delim = delimbuf[0]; } @@ -810,7 +810,7 @@ static void cmd_parse_myrights (IMAP_DATA* idata, const char* s) while (*s && !isspace((unsigned char) *s)) { - switch (*s) + switch (*s) { case 'l': mutt_bit_set (idata->ctx->rights, MUTT_ACL_LOOKUP); @@ -967,14 +967,14 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s) { if (inc->magic != MUTT_IMAP) continue; - + if (imap_parse_path (inc->path, &mx) < 0) { mutt_debug (1, "Error parsing mailbox %s, skipping\n", inc->path); continue; } /* mutt_debug (2, "Buffy entry: [%s] mbox: [%s]\n", inc->path, NONULL(mx.mbox)); */ - + if (imap_account_match (&idata->conn->account, &mx.account)) { if (mx.mbox) @@ -990,7 +990,7 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s) { mutt_debug (3, "Found %s in buffy list (OV: %d ON: %d U: %d)\n", mailbox, olduv, oldun, status->unseen); - + if (option(OPTMAILCHECKRECENT)) { if (olduv && olduv == status->uidvalidity) diff --git a/imap/imap.h b/imap/imap.h index 1419270ac..9a2238e03 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-1998 Michael R. Elkins * Copyright (C) 2000-2007 Brendan Cully - * + * * 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. - */ + */ #ifndef _IMAP_H #define _IMAP_H 1 diff --git a/imap/imap_private.h b/imap/imap_private.h index 089cae4ff..210cef4df 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-1999 Brandon Long * Copyright (C) 1999-2009 Brendan Cully - * + * * 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. - */ + */ #ifndef _IMAP_PRIVATE_H #define _IMAP_PRIVATE_H 1 @@ -88,7 +88,7 @@ enum IMAP_CONNECTED, IMAP_AUTHENTICATED, IMAP_SELECTED, - + /* and pseudo-states */ IMAP_IDLE }; @@ -188,7 +188,7 @@ typedef struct time_t lastread; /* last time we read a command for the server */ char* buf; unsigned int blen; - + /* If nonzero, we can send UTF-8, and the server will use UTF8 rather * than mUTF7 */ int unicode; @@ -286,7 +286,7 @@ int imap_continue (const char* msg, const char* resp); void imap_error (const char* where, const char* msg); IMAP_DATA* imap_new_idata (void); void imap_free_idata (IMAP_DATA** idata); -char* imap_fix_path (IMAP_DATA* idata, const char* mailbox, char* path, +char* imap_fix_path (IMAP_DATA* idata, const char* mailbox, char* path, size_t plen); void imap_cachepath(IMAP_DATA* idata, const char* mailbox, char* dest, size_t dlen); diff --git a/imap/message.h b/imap/message.h index 003bb2e94..add0d0a63 100644 --- a/imap/message.h +++ b/imap/message.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-1999 Brandon Long * Copyright (C) 1999-2000,2005 Brendan Cully - * + * * 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. - */ + */ /* message.c data structures */ diff --git a/imap/utf7.c b/imap/utf7.c index b5a6141e4..1996f15f7 100644 --- a/imap/utf7.c +++ b/imap/utf7.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2000,2003 Edmund Grimley Evans - * + * * 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" diff --git a/init.c b/init.c index 78b306f66..615106447 100644 --- a/init.c +++ b/init.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2010,2013,2016 Michael R. Elkins - * + * * 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" @@ -829,7 +829,7 @@ static int parse_unignore (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *e mutt_extract_token (buf, s, 0); /* don't add "*" to the unignore list */ - if (strcmp (buf->data, "*")) + if (strcmp (buf->data, "*")) add_to_list (&UnIgnore, buf->data); remove_from_list (&Ignore, buf->data); @@ -867,7 +867,7 @@ static int parse_list (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) static void _alternates_clean (void) { int i; - if (Context && Context->msgcount) + if (Context && Context->msgcount) { for (i = 0; i < Context->msgcount; i++) Context->hdrs[i]->recip_valid = 0; @@ -877,7 +877,7 @@ static void _alternates_clean (void) static int parse_alternates (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { group_context_t *gc = NULL; - + _alternates_clean(); do @@ -896,10 +896,10 @@ static int parse_alternates (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER goto bail; } while (MoreArgs (s)); - + mutt_group_context_destroy (&gc); return 0; - + bail: mutt_group_context_destroy (&gc); return -1; @@ -983,7 +983,7 @@ static int parse_unreplace_list (BUFFER *buf, BUFFER *s, unsigned long data, BUF static void clear_subject_mods (void) { int i; - if (Context && Context->msgcount) + if (Context && Context->msgcount) { for (i = 0; i < Context->msgcount; i++) FREE(&Context->hdrs[i]->env->disp_subj); @@ -1114,15 +1114,15 @@ static int parse_lists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) do { mutt_extract_token (buf, s, 0); - + if (parse_group_context (&gc, buf, s, data, err) == -1) goto bail; - + mutt_remove_from_rx_list (&UnMailLists, buf->data); - + if (mutt_add_to_rx_list (&MailLists, buf->data, REG_ICASE, err) != 0) goto bail; - + if (mutt_group_context_add_rx (gc, buf->data, REG_ICASE, err) != 0) goto bail; } @@ -1130,7 +1130,7 @@ static int parse_lists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) mutt_group_context_destroy (&gc); return 0; - + bail: mutt_group_context_destroy (&gc); return -1; @@ -1186,7 +1186,7 @@ static int parse_group (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) if ((addr = mutt_parse_adrlist (NULL, buf->data)) == NULL) goto bail; if (mutt_addrlist_to_intl (addr, &estr)) - { + { snprintf (err->data, err->dsize, _("%sgroup: warning: bad IDN '%s'.\n"), data == 1 ? "un" : "", estr); rfc822_free_address (&addr); @@ -1216,7 +1216,7 @@ bail: static void _attachments_clean (void) { int i; - if (Context && Context->msgcount) + if (Context && Context->msgcount) { for (i = 0; i < Context->msgcount; i++) Context->hdrs[i]->attach_valid = 0; @@ -1250,7 +1250,7 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err) if (!buf->data || *buf->data == '\0') continue; - + a = safe_malloc(sizeof(ATTACH_MATCH)); /* some cheap hacks that I expect to remove */ @@ -1309,7 +1309,7 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err) lastp = listp; } while (MoreArgs (s)); - + _attachments_clean(); return 0; } @@ -1379,7 +1379,7 @@ static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *er } while (MoreArgs (s)); - + FREE(&tmp); _attachments_clean(); return 0; @@ -1494,8 +1494,8 @@ static int parse_unlists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *er mutt_extract_token (buf, s, 0); mutt_remove_from_rx_list (&SubscribedLists, buf->data); mutt_remove_from_rx_list (&MailLists, buf->data); - - if (mutt_strcmp (buf->data, "*") && + + if (mutt_strcmp (buf->data, "*") && mutt_add_to_rx_list (&UnMailLists, buf->data, REG_ICASE, err) != 0) return -1; } @@ -1507,14 +1507,14 @@ static int parse_unlists (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *er static int parse_subscribe (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { group_context_t *gc = NULL; - + do { mutt_extract_token (buf, s, 0); if (parse_group_context (&gc, buf, s, data, err) == -1) goto bail; - + mutt_remove_from_rx_list (&UnMailLists, buf->data); mutt_remove_from_rx_list (&UnSubscribedLists, buf->data); @@ -1526,10 +1526,10 @@ static int parse_subscribe (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER * goto bail; } while (MoreArgs (s)); - + mutt_group_context_destroy (&gc); return 0; - + bail: mutt_group_context_destroy (&gc); return -1; @@ -1541,7 +1541,7 @@ static int parse_unsubscribe (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER { mutt_extract_token (buf, s, 0); mutt_remove_from_rx_list (&SubscribedLists, buf->data); - + if (mutt_strcmp (buf->data, "*") && mutt_add_to_rx_list (&UnSubscribedLists, buf->data, REG_ICASE, err) != 0) return -1; @@ -1550,7 +1550,7 @@ static int parse_unsubscribe (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER return 0; } - + static int parse_unalias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { ALIAS *tmp, *last = NULL; @@ -1563,7 +1563,7 @@ static int parse_unalias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *er { if (CurrentMenu == MENU_ALIAS) { - for (tmp = Aliases; tmp ; tmp = tmp->next) + for (tmp = Aliases; tmp ; tmp = tmp->next) tmp->del = 1; set_option (OPTFORCEREDRAWINDEX); } @@ -1604,7 +1604,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) ALIAS *last = NULL; char *estr = NULL; group_context_t *gc = NULL; - + if (!MoreArgs (s)) { strfcpy (err->data, _("alias: no address"), err->dsize); @@ -1615,7 +1615,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) if (parse_group_context (&gc, buf, s, data, err) == -1) return -1; - + /* check to see if an alias with this name already exists */ for (; tmp; tmp = tmp->next) { @@ -1664,7 +1664,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) mutt_alias_add_reverse (tmp); #ifdef DEBUG - if (debuglevel >= 2) + if (debuglevel >= 2) { ADDRESS *a; /* A group is terminated with an empty address, so check a->mailbox */ @@ -1679,7 +1679,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) #endif mutt_group_context_destroy (&gc); return 0; - + bail: mutt_group_context_destroy (&gc); return -1; @@ -1785,7 +1785,7 @@ parse_sort (short *val, const char *s, const struct mapping_t *map, BUFFER *err) s += 8; flags = SORT_REVERSE; } - + if (mutt_strncmp ("last-", s, 5) == 0) { s += 5; @@ -1843,7 +1843,7 @@ static void mutt_restore_default (struct option_t *p) switch (p->type & DT_MASK) { case DT_STR: - mutt_str_replace ((char **) p->data, (char *) p->init); + mutt_str_replace ((char **) p->data, (char *) p->init); break; case DT_MBCHARTBL: free_mbchar_table ((mbchar_table **)p->data); @@ -2216,7 +2216,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) snprintf (err->data, err->dsize, _("value is illegal with reset")); return (-1); } - + if (!mutt_strcmp ("all", tmp->data)) { if (CurrentMenu == MENU_PAGER) @@ -2242,9 +2242,9 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) else mutt_restore_default (&MuttVars[idx]); } - } + } else if (!myvar && DTYPE (MuttVars[idx].type) == DT_BOOL) - { + { if (s && *s->dptr == '=') { if (unset || inv || query) @@ -2296,7 +2296,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) else if (DTYPE (MuttVars[idx].type) == DT_MBCHARTBL) free_mbchar_table ((mbchar_table **) MuttVars[idx].data); else - /* MuttVars[idx].data is already 'char**' (or some 'void**') or... + /* MuttVars[idx].data is already 'char**' (or some 'void**') or... * so cast to 'void*' is okay */ FREE ((void *) MuttVars[idx].data); /* __FREE_CHECKED__ */ } @@ -2338,7 +2338,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) } else val = *((char **) MuttVars[idx].data); - + /* user requested the value of this variable */ pretty_var (err->data, err->dsize, MuttVars[idx].option, NONULL(val)); break; @@ -2365,7 +2365,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) } else if (DTYPE (MuttVars[idx].type) == DT_PATH) { - /* MuttVars[idx].data is already 'char**' (or some 'void**') or... + /* MuttVars[idx].data is already 'char**' (or some 'void**') or... * so cast to 'void*' is okay */ FREE ((void *) MuttVars[idx].data); /* __FREE_CHECKED__ */ @@ -2426,7 +2426,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) r = -1; break; } - + CHECK_PAGER; s->dptr++; @@ -2440,7 +2440,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) { regmatch_t pmatch[1]; int i; - + #define CUR_ENV Context->hdrs[i]->env for (i = 0; i < Context->msgcount; i++) { @@ -2448,7 +2448,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) { CUR_ENV->real_subj = (regexec (ReplyRegexp.rx, CUR_ENV->subject, 1, pmatch, 0)) ? - CUR_ENV->subject : + CUR_ENV->subject : CUR_ENV->subject + pmatch[0].rm_eo; } } @@ -2628,7 +2628,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) r = -1; break; } - + if (query || *s->dptr != '=') { p = mutt_getnamebyvalue (*((short *) MuttVars[idx].data) & SORT_MASK, map); @@ -2807,19 +2807,19 @@ static int source_rc (const char *rcfile_path, BUFFER *err) while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, MUTT_CONT)) != NULL) { conv=ConfigCharset && (*ConfigCharset) && Charset; - if (conv) + if (conv) { currentline=safe_strdup(linebuf); if (!currentline) continue; mutt_convert_string(¤tline, ConfigCharset, Charset, 0); - } - else + } + else currentline=linebuf; line_rc = mutt_parse_rc_line (currentline, &token, err); if (line_rc == -1) { mutt_error (_("Error in %s, line %d: %s"), rcfile, line, err->data); - if (--rc < -MAXERRS) + if (--rc < -MAXERRS) { if (conv) FREE(¤tline); break; @@ -2830,7 +2830,7 @@ static int source_rc (const char *rcfile_path, BUFFER *err) if (rc < 0) rc = -1; } - if (conv) + if (conv) FREE(¤tline); } FREE (&token.data); @@ -2934,9 +2934,9 @@ finish: #define NUMVARS (sizeof (MuttVars)/sizeof (MuttVars[0])) #define NUMCOMMANDS (sizeof (Commands)/sizeof (Commands[0])) -/* initial string that starts completion. No telling how much crap +/* initial string that starts completion. No telling how much crap * the user has typed so far. Allocate LONG_STRING just to be sure! */ -static char User_typed [LONG_STRING] = {0}; +static char User_typed [LONG_STRING] = {0}; static int Num_matched = 0; /* Number of matches for completion */ static char Completed [STRING] = {0}; /* completed string (command or variable) */ @@ -2950,7 +2950,7 @@ static void matches_ensure_morespace(int current) if (current > Matches_listsize - 2) { - base_space = MAX(NUMVARS,NUMCOMMANDS) + 1; + base_space = MAX(NUMVARS,NUMCOMMANDS) + 1; extra_space = Matches_listsize - base_space; extra_space *= 2; space = base_space + extra_space; @@ -3048,7 +3048,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) snprintf(Completed, sizeof(Completed),"%s", Matches[0]); else if (numtabs > 1 && Num_matched > 2) /* cycle thru all the matches */ - snprintf(Completed, sizeof(Completed), "%s", + snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % Num_matched]); /* return the completed command */ @@ -3060,7 +3060,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) || !mutt_strncmp (buffer, "toggle", 6)) { /* complete variables */ static const char * const prefixes[] = { "no", "inv", "?", "&", 0 }; - + pt++; /* loop through all the possible prefixes (no, inv, ...) */ if (!mutt_strncmp (buffer, "set", 3)) @@ -3074,7 +3074,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) } } } - + /* first TAB. Collect all the matches */ if (numtabs == 1) { @@ -3104,7 +3104,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) snprintf(Completed, sizeof(Completed),"%s", Matches[0]); else if (numtabs > 1 && Num_matched > 2) /* cycle thru all the matches */ - snprintf(Completed, sizeof(Completed), "%s", + snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % Num_matched]); strncpy (pt, Completed, buffer + len - pt - spaces); @@ -3115,7 +3115,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) if (!menu && CurrentMenu != MENU_PAGER) menu = OpGeneric; - + pt++; /* first TAB. Collect all the matches */ if (numtabs == 1) @@ -3127,7 +3127,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) for (num = 0; menu[num].name; num++) candidate (Completed, User_typed, menu[num].name, sizeof (Completed)); /* try the generic menu */ - if (Completed[0] == 0 && CurrentMenu != MENU_PAGER) + if (Completed[0] == 0 && CurrentMenu != MENU_PAGER) { menu = OpGeneric; for (num = 0; menu[num].name; num++) @@ -3151,7 +3151,7 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) snprintf(Completed, sizeof(Completed),"%s", Matches[0]); else if (numtabs > 1 && Num_matched > 2) /* cycle thru all the matches */ - snprintf(Completed, sizeof(Completed), "%s", + snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % Num_matched]); strncpy (pt, Completed, buffer + len - pt - spaces); @@ -3166,7 +3166,7 @@ int mutt_var_value_complete (char *buffer, size_t len, int pos) { char var[STRING], *pt = buffer; int spaces; - + if (buffer[0] == 0) return 0; @@ -3481,9 +3481,9 @@ int var_to_string (int idx, char* val, size_t len) int mutt_query_variables (LIST *queries) { LIST *p; - + char command[STRING]; - + BUFFER err, token; mutt_buffer_init (&err); @@ -3491,7 +3491,7 @@ int mutt_query_variables (LIST *queries) err.dsize = STRING; err.data = safe_malloc (err.dsize); - + for (p = queries; p; p = p->next) { snprintf (command, sizeof (command), "set ?%s\n", p->data); @@ -3505,7 +3505,7 @@ int mutt_query_variables (LIST *queries) } printf ("%s\n", err.data); } - + FREE (&token.data); FREE (&err.data); @@ -3516,9 +3516,9 @@ int mutt_query_variables (LIST *queries) int mutt_dump_variables (int hide_sensitive) { int i; - + char command[STRING]; - + BUFFER err, token; mutt_buffer_init (&err); @@ -3526,7 +3526,7 @@ int mutt_dump_variables (int hide_sensitive) err.dsize = STRING; err.data = safe_malloc (err.dsize); - + for (i = 0; MuttVars[i].option; i++) { if (MuttVars[i].type == DT_SYN) @@ -3548,7 +3548,7 @@ int mutt_dump_variables (int hide_sensitive) } printf("%s\n", err.data); } - + FREE (&token.data); FREE (&err.data); @@ -3692,7 +3692,7 @@ void mutt_init (int skip_sys_rc, LIST *commands) snprintf (AttachmentMarker, sizeof (AttachmentMarker), "\033]9;%" PRIu64 "\a", mutt_rand64()); - + /* on one of the systems I use, getcwd() does not return the same prefix as is listed in the passwd file */ if ((p = getenv ("HOME"))) @@ -3711,7 +3711,7 @@ void mutt_init (int skip_sys_rc, LIST *commands) Shell = safe_strdup (pw->pw_shell); endpwent (); } - else + else { if (!Homedir) { @@ -3858,12 +3858,12 @@ void mutt_init (int skip_sys_rc, LIST *commands) if ((p = getenv ("EMAIL")) != NULL) From = rfc822_parse_adrlist (NULL, p); - + mutt_set_langinfo_charset (); mutt_set_charset (Charset); - + Matches = safe_calloc (Matches_listsize, sizeof (char *)); - + /* Set standard defaults */ for (i = 0; MuttVars[i].option; i++) { @@ -4045,27 +4045,27 @@ static int parse_group_context (group_context_t **ctx, BUFFER *buf, BUFFER *s, u { while (!mutt_strcasecmp (buf->data, "-group")) { - if (!MoreArgs (s)) + if (!MoreArgs (s)) { strfcpy (err->data, _("-group: no group name"), err->dsize); goto bail; } - + mutt_extract_token (buf, s, 0); mutt_group_context_add (ctx, mutt_pattern_group (buf->data)); - + if (!MoreArgs (s)) { strfcpy (err->data, _("out of arguments"), err->dsize); goto bail; } - + mutt_extract_token (buf, s, 0); } - + return 0; - + bail: mutt_group_context_destroy (ctx); return -1; @@ -4145,10 +4145,10 @@ static void myvar_set (const char* var, const char* val) if (!*cur) *cur = safe_calloc (1, sizeof (myvar_t)); - + if (!(*cur)->name) (*cur)->name = safe_strdup (var); - + mutt_str_replace (&(*cur)->value, val); } @@ -4156,13 +4156,13 @@ static void myvar_del (const char* var) { myvar_t **cur; myvar_t *tmp; - + for (cur = &MyVars; *cur; cur = &((*cur)->next)) if (!mutt_strcmp ((*cur)->name, var)) break; - - if (*cur) + + if (*cur) { tmp = (*cur)->next; FREE (&(*cur)->name); @@ -4226,7 +4226,7 @@ int mutt_label_complete (char *buffer, size_t len, int numtabs) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && Num_matched > 2) /* cycle thru all the matches */ - snprintf(Completed, sizeof(Completed), "%s", + snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % Num_matched]); /* return the completed label */ diff --git a/intl/COPYING.LIB-2 b/intl/COPYING.LIB-2 index 6225a11f0..7b129099d 100644 --- a/intl/COPYING.LIB-2 +++ b/intl/COPYING.LIB-2 @@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/intl/COPYING.LIB-2.1 b/intl/COPYING.LIB-2.1 index 3bb09437a..7e2a8bf5c 100644 --- a/intl/COPYING.LIB-2.1 +++ b/intl/COPYING.LIB-2.1 @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c index 3047d6fcf..152d31025 100644 --- a/intl/bindtextdom.c +++ b/intl/bindtextdom.c @@ -85,7 +85,7 @@ __libc_rwlock_define (extern, _nl_state_lock) static void set_binding_values PARAMS ((const char *domainname, const char **dirnamep, const char **codesetp)); - + /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not diff --git a/intl/locale.alias b/intl/locale.alias index 68fc9cc0c..58b247cb9 100644 --- a/intl/locale.alias +++ b/intl/locale.alias @@ -27,7 +27,7 @@ # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. -# Packages using this file: +# Packages using this file: bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 diff --git a/keymap.c b/keymap.c index 73fba6475..ddb8f74d9 100644 --- a/keymap.c +++ b/keymap.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2002,2010-2011 Michael R. Elkins - * + * * 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" @@ -55,7 +55,7 @@ const struct mapping_t Menus[] = { #ifdef MIXMASTER { "mix", MENU_MIX }, #endif - + { "query", MENU_QUERY }, { "generic", MENU_GENERIC }, @@ -86,7 +86,7 @@ static struct mapping_t KeyNames[] = { #endif #ifdef KEY_NEXT { "", KEY_NEXT }, -#endif +#endif #ifdef NCURSES_VERSION /* extensions supported by ncurses. values are filled in during initialization */ @@ -187,14 +187,14 @@ static int parsekeys (const char *str, keycode_t *d, int max) strfcpy(buff, str, sizeof(buff)); s = buff; - + while (*s && len) { *d = '\0'; if(*s == '<' && (t = strchr(s, '>'))) { t++; c = *t; *t = '\0'; - + if ((n = mutt_getvaluebyname (s, KeyNames)) != -1) { s = t; @@ -210,7 +210,7 @@ static int parsekeys (const char *str, keycode_t *d, int max) s = t; *d = n; } - + *t = c; } @@ -302,7 +302,7 @@ static int get_op (const struct binding_t *bindings, const char *start, size_t l for (i = 0; bindings[i].name; i++) { - if (!ascii_strncasecmp (start, bindings[i].name, len) && + if (!ascii_strncasecmp (start, bindings[i].name, len) && mutt_strlen (bindings[i].name) == len) return bindings[i].op; } @@ -487,7 +487,7 @@ int km_dokey (int menu) if (menu != MENU_EDITOR && menu != MENU_PAGER) { /* check generic menu */ - bindings = OpGeneric; + bindings = OpGeneric; if ((func = get_func (bindings, tmp.op))) return tmp.op; } @@ -743,15 +743,15 @@ void km_init (void) #ifdef MIXMASTER create_bindings (OpMix, MENU_MIX); - + km_bindkey ("", MENU_MIX, OP_GENERIC_SELECT_ENTRY); km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV); km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT); #endif - + /* bindings for the line editor */ create_bindings (OpEditor, MENU_EDITOR); - + km_bindkey ("", MENU_EDITOR, OP_EDITOR_HISTORY_UP); km_bindkey ("", MENU_EDITOR, OP_EDITOR_HISTORY_DOWN); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKWARD_CHAR); @@ -761,10 +761,10 @@ void km_init (void) km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKSPACE); km_bindkey ("", MENU_EDITOR, OP_EDITOR_BACKSPACE); km_bindkey ("\177", MENU_EDITOR, OP_EDITOR_BACKSPACE); - + /* generic menu keymap */ create_bindings (OpGeneric, MENU_GENERIC); - + km_bindkey ("", MENU_GENERIC, OP_FIRST_ENTRY); km_bindkey ("", MENU_GENERIC, OP_LAST_ENTRY); km_bindkey ("", MENU_GENERIC, OP_NEXT_PAGE); @@ -787,7 +787,7 @@ void km_init (void) km_bindkey ("", MENU_GENERIC, OP_GENERIC_SELECT_ENTRY); /* Miscellaneous extra bindings */ - + km_bindkey (" ", MENU_MAIN, OP_DISPLAY_MESSAGE); km_bindkey ("", MENU_MAIN, OP_MAIN_PREV_UNDELETED); km_bindkey ("", MENU_MAIN, OP_MAIN_NEXT_UNDELETED); @@ -821,7 +821,7 @@ void km_init (void) km_bindkey ("", MENU_PAGER, OP_NEXT_LINE); km_bindkey ("", MENU_PAGER, OP_NEXT_LINE); - + km_bindkey ("", MENU_ALIAS, OP_GENERIC_SELECT_ENTRY); km_bindkey ("", MENU_ALIAS, OP_GENERIC_SELECT_ENTRY); km_bindkey ("", MENU_ALIAS, OP_TAG); @@ -843,7 +843,7 @@ void km_error_key (int menu) if(!(key = km_find_func(menu, OP_HELP))) key = km_find_func(MENU_GENERIC, OP_HELP); - + if(!(km_expand_key(buf, sizeof(buf), key))) { mutt_error (_("Key is not bound.")); @@ -932,7 +932,7 @@ static int try_bind (char *key, int menu, char *func, const struct binding_t *bindings) { int i; - + for (i = 0; bindings[i].name; i++) if (mutt_strcmp (func, bindings[i].name) == 0) { @@ -1088,7 +1088,7 @@ int mutt_parse_macro (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) /* exec function-name */ int mutt_parse_exec (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { - int ops[128]; + int ops[128]; int nops = 0; const struct binding_t *bindings = NULL; char *function; @@ -1104,7 +1104,7 @@ int mutt_parse_exec (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) mutt_extract_token (buf, s, 0); function = buf->data; - if ((bindings = km_get_table (CurrentMenu)) == NULL + if ((bindings = km_get_table (CurrentMenu)) == NULL && CurrentMenu != MENU_PAGER) bindings = OpGeneric; diff --git a/keymap.h b/keymap.h index 3994861b0..0f11a9849 100644 --- a/keymap.h +++ b/keymap.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2002,2010 Michael R. Elkins - * + * * 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. - */ + */ #ifndef KEYMAP_H #define KEYMAP_H @@ -64,7 +64,7 @@ enum MENU_POST, MENU_QUERY, - + MENU_PGP, MENU_SMIME, @@ -72,7 +72,7 @@ enum MENU_KEY_SELECT_PGP, MENU_KEY_SELECT_SMIME, #endif - + #ifdef MIXMASTER MENU_MIX, #endif diff --git a/lib.c b/lib.c index 801870400..a95548e80 100644 --- a/lib.c +++ b/lib.c @@ -1,24 +1,24 @@ /* * Copyright (C) 1996-2000,2007,2010 Michael R. Elkins * Copyright (C) 1999-2004,2006-2007 Thomas Roessler - * + * * 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 used to contain some more functions, namely those @@ -55,8 +55,8 @@ static const struct sysexits { int v; const char *str; -} -sysexits_h[] = +} +sysexits_h[] = { #ifdef EX_USAGE { 0xff & EX_USAGE, "Bad usage." }, @@ -130,7 +130,7 @@ void *safe_calloc (size_t nmemb, size_t size) sleep (1); mutt_exit (1); } - + if (!(p = calloc (nmemb, size))) { mutt_error (_("Out of memory!")); @@ -201,10 +201,10 @@ void safe_free (void *ptr) /* __SAFE_FREE_CHECKED__ */ int safe_fclose (FILE **f) { int r = 0; - + if (*f) r = fclose (*f); - + *f = NULL; return r; } @@ -246,18 +246,18 @@ char *safe_strcat (char *d, size_t l, const char *s) { char *p = d; - if (!l) + if (!l) return d; l--; /* Space for the trailing '\0'. */ - + for (; *d && l; l--) d++; for (; *s && l; l--) *d++ = *s++; *d = '\0'; - + return p; } @@ -267,16 +267,16 @@ char *safe_strncat (char *d, size_t l, const char *s, size_t sl) if (!l) return d; - + l--; /* Space for the trailing '\0'. */ - + for (; *d && l; l--) d++; for (; *s && l && sl; l--, sl--) *d++ = *s++; *d = '\0'; - + return p; } @@ -335,25 +335,25 @@ void mutt_unlink (const char *s) char buf[2048]; /* Defend against symlink attacks */ - -#ifdef O_NOFOLLOW + +#ifdef O_NOFOLLOW flags = O_RDWR | O_NOFOLLOW; #else flags = O_RDWR; #endif - + if (lstat (s, &sb) == 0 && S_ISREG(sb.st_mode)) { if ((fd = open (s, flags)) < 0) return; - - if ((fstat (fd, &sb2) != 0) || !S_ISREG (sb2.st_mode) + + if ((fstat (fd, &sb2) != 0) || !S_ISREG (sb2.st_mode) || (sb.st_dev != sb2.st_dev) || (sb.st_ino != sb2.st_ino)) { close (fd); return; } - + if ((f = fdopen (fd, "r+"))) { unlink (s); @@ -405,7 +405,7 @@ int mutt_copy_stream (FILE *fin, FILE *fout) return 0; } -int +int compare_stat (struct stat *osb, struct stat *nsb) { if (osb->st_dev != nsb->st_dev || osb->st_ino != nsb->st_ino || @@ -423,10 +423,10 @@ int safe_symlink(const char *oldpath, const char *newpath) if(!oldpath || !newpath) return -1; - + if(unlink(newpath) == -1 && errno != ENOENT) return -1; - + if (oldpath[0] == '/') { if (symlink (oldpath, newpath) == -1) @@ -439,7 +439,7 @@ int safe_symlink(const char *oldpath, const char *newpath) if ((getcwd (abs_oldpath, sizeof abs_oldpath) == NULL) || (strlen (abs_oldpath) + 1 + strlen (oldpath) + 1 > sizeof abs_oldpath)) return -1; - + strcat (abs_oldpath, "/"); /* __STRCAT_CHECKED__ */ strcat (abs_oldpath, oldpath); /* __STRCAT_CHECKED__ */ if (symlink (abs_oldpath, newpath) == -1) @@ -452,15 +452,15 @@ int safe_symlink(const char *oldpath, const char *newpath) unlink(newpath); return -1; } - + return 0; } -/* +/* * This function is supposed to do nfs-safe renaming of files. - * + * * Warning: We don't check whether src and target are equal. */ @@ -477,15 +477,15 @@ int safe_rename (const char *src, const char *target) /* * Coda does not allow cross-directory links, but tells * us it's a cross-filesystem linking attempt. - * + * * However, the Coda rename call is allegedly safe to use. - * - * With other file systems, rename should just fail when + * + * With other file systems, rename should just fail when * the files reside on different file systems, so it's safe * to try it here. * */ - + mutt_debug (1, "safe_rename: link (%s, %s) failed: %s (%d)\n", src, target, strerror (errno), errno); @@ -503,14 +503,14 @@ int safe_rename (const char *src, const char *target) ) { mutt_debug (1, "safe_rename: trying rename...\n"); - if (rename (src, target) == -1) + if (rename (src, target) == -1) { mutt_debug (1, "safe_rename: rename (%s, %s) failed: %s (%d)\n", src, target, strerror (errno), errno); return -1; } mutt_debug (1, "safe_rename: rename succeeded.\n"); - + return 0; } @@ -520,14 +520,14 @@ int safe_rename (const char *src, const char *target) /* * Stat both links and check if they are equal. */ - + if (lstat (src, &ssb) == -1) { mutt_debug (1, "safe_rename: can't stat %s: %s (%d)\n", src, strerror (errno), errno); return -1; } - + if (lstat (target, &tsb) == -1) { mutt_debug (1, "safe_rename: can't stat %s: %s (%d)\n", @@ -535,7 +535,7 @@ int safe_rename (const char *src, const char *target) return -1; } - /* + /* * pretend that the link failed because the target file * did already exist. */ @@ -553,12 +553,12 @@ int safe_rename (const char *src, const char *target) * value here? XXX */ - if (unlink (src) == -1) + if (unlink (src) == -1) { mutt_debug (1, "safe_rename: unlink (%s) failed: %s (%d)\n", src, strerror (errno), errno); } - + return 0; } @@ -566,7 +566,7 @@ int safe_rename (const char *src, const char *target) /* Create a temporary directory next to a file name */ -static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, +static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, char *newdir, size_t ndlen) { const char *basename; @@ -574,7 +574,7 @@ static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, char *p; strfcpy (parent, NONULL (path), sizeof (parent)); - + if ((p = strrchr (parent, '/'))) { *p = '\0'; @@ -592,14 +592,14 @@ static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, mutt_debug (1, "mutt_mkwrapdir: mkdtemp() failed\n"); return -1; } - + if (snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename)) >= nflen) { rmdir(newdir); mutt_debug (1, "mutt_mkwrapdir: string was truncated\n"); return -1; } - return 0; + return 0; } /* remove a directory and everything under it */ @@ -645,7 +645,7 @@ int mutt_rmtree (const char* path) static int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir) { int rv; - + rv = safe_rename (safe_file, path); unlink (safe_file); rmdir (safe_dir); @@ -657,7 +657,7 @@ int safe_open (const char *path, int flags) struct stat osb, nsb; int fd; - if (flags & O_EXCL) + if (flags & O_EXCL) { char safe_file[_POSIX_PATH_MAX]; char safe_dir[_POSIX_PATH_MAX]; @@ -665,7 +665,7 @@ int safe_open (const char *path, int flags) if (mutt_mkwrapdir (path, safe_file, sizeof (safe_file), safe_dir, sizeof (safe_dir)) == -1) return -1; - + if ((fd = open (safe_file, flags, 0600)) < 0) { rmdir (safe_dir); @@ -680,7 +680,7 @@ int safe_open (const char *path, int flags) if ((fd = open (path, flags & ~O_EXCL, 0600)) < 0) return fd; - + /* make sure the file is not symlink */ if (lstat (path, &osb) < 0 || fstat (fd, &nsb) < 0 || compare_stat(&osb, &nsb) == -1) @@ -749,9 +749,9 @@ int mutt_rx_sanitize_string (char *dest, size_t destlen, const char *src) } *dest++ = *src++; } - + *dest = '\0'; - + if (*src) return -1; else @@ -858,7 +858,7 @@ size_t mutt_quote_filename (char *d, size_t l, const char *f) { size_t i, j = 0; - if(!f) + if(!f) { *d = '\0'; return 0; @@ -866,9 +866,9 @@ size_t mutt_quote_filename (char *d, size_t l, const char *f) /* leave some space for the trailing characters. */ l -= 6; - + d[j++] = '\''; - + for(i = 0; j < l && f[i]; i++) { if(f[i] == '\'' || f[i] == '`') @@ -881,10 +881,10 @@ size_t mutt_quote_filename (char *d, size_t l, const char *f) else d[j++] = f[i]; } - + d[j++] = '\''; d[j] = '\0'; - + return j; } @@ -952,7 +952,7 @@ char *mutt_skip_whitespace (char *p) void mutt_remove_trailing_ws (char *s) { char *p; - + for (p = s + mutt_strlen (s) - 1 ; p >= s && ISSPACE (*p) ; p--) *p = 0; } @@ -1003,10 +1003,10 @@ char *mutt_concatn_path (char *dst, size_t dstlen, char *mutt_concat_path (char *d, const char *dir, const char *fname, size_t l) { const char *fmt = "%s/%s"; - + if (!*fname || (*dir && dir[strlen(dir)-1] == '/')) fmt = "%s%s"; - + snprintf (d, l, fmt, dir, fname); return d; } @@ -1024,13 +1024,13 @@ const char * mutt_strsysexit(int e) { int i; - + for(i = 0; sysexits_h[i].str; i++) { if(e == sysexits_h[i].v) break; } - + return sysexits_h[i].str; } diff --git a/lib.h b/lib.h index 9266ad460..8020cc8df 100644 --- a/lib.h +++ b/lib.h @@ -1,24 +1,24 @@ /* * Copyright (C) 1996-2000,2007,2010,2012 Michael R. Elkins * Copyright (C) 1999-2005,2007 Thomas Roessler - * + * * 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. - */ + */ /* mutt functions which are generally useful. */ @@ -64,7 +64,7 @@ /* * Create a format string to be used with scanf. * To use it, write, for instance, MUTT_FORMAT(HUGE_STRING). - * + * * See K&R 2nd ed, p. 231 for an explanation. */ # define _MUTT_FORMAT_2(a,b) "%" a b diff --git a/m4/gpgme.m4 b/m4/gpgme.m4 index 44bf43cb9..434bb956c 100644 --- a/m4/gpgme.m4 +++ b/m4/gpgme.m4 @@ -57,7 +57,7 @@ AC_DEFUN([AM_PATH_GPGME], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes @@ -125,7 +125,7 @@ AC_DEFUN([AM_PATH_GPGME_PTH], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes @@ -195,7 +195,7 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes @@ -264,7 +264,7 @@ AC_DEFUN([AM_PATH_GPGME_GLIB], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes diff --git a/mailbox.h b/mailbox.h index 9b2443c73..6b545ea65 100644 --- a/mailbox.h +++ b/mailbox.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002 Michael R. Elkins - * + * * 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. - */ + */ #ifndef _MAILBOX_H #define _MAILBOX_H diff --git a/main.c b/main.c index 735283b16..b03995ea2 100644 --- a/main.c +++ b/main.c @@ -2,21 +2,21 @@ * Copyright (C) 1996-2007,2010,2013 Michael R. Elkins * Copyright (C) 1999-2007 Thomas Roessler * Copyright (C) 2004 g10 Code GmbH - * + * * 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. - */ + */ #define MAIN_C 1 @@ -118,7 +118,7 @@ options:\n\ -m \tspecify a default mailbox type\n\ -n\t\tcauses Mutt not to read the system Muttrc\n\ -p\t\trecall a postponed message")); - + puts (_("\ -Q \tquery a configuration variable\n\ -R\t\topen mailbox in read-only mode\n\ @@ -208,7 +208,7 @@ int main (int argc, char **argv, char **environ) int double_dash = argc, nargc = 1; /* sanity check against stupid administrators */ - + if(getegid() != getgid()) { fprintf(stderr, "%s: I don't want to run with privileges!\n", @@ -246,7 +246,7 @@ int main (int argc, char **argv, char **environ) for (optind = 1; optind < double_dash; ) { /* We're getopt'ing POSIXLY, so we'll be here every time getopt() - * encounters a non-option. That could be a file to attach + * encounters a non-option. That could be a file to attach * (all non-options between -a and --) or it could be an address * (which gets collapsed to the front of argv). */ @@ -341,7 +341,7 @@ int main (int argc, char **argv, char **environ) case 'm': /* should take precedence over .muttrc setting, so save it for later */ - newMagic = optarg; + newMagic = optarg; break; case 'n': @@ -355,7 +355,7 @@ int main (int argc, char **argv, char **environ) case 'Q': queries = mutt_add_list (queries, optarg); break; - + case 'R': flags |= MUTT_RO; /* read-only mode */ break; @@ -474,7 +474,7 @@ int main (int argc, char **argv, char **environ) for (; alias_queries; alias_queries = alias_queries->next) { if ((a = mutt_lookup_alias (alias_queries->data))) - { + { /* output in machine-readable form */ mutt_addrlist_to_intl (a, NULL); mutt_write_address_list (a, stdout, 0, 0); @@ -541,7 +541,7 @@ int main (int argc, char **argv, char **environ) char *bodytext = NULL, *bodyfile = NULL; int rv = 0; char expanded_infile[_POSIX_PATH_MAX]; - + if (!option (OPTNOCURSES)) mutt_flushinp (); diff --git a/mapping.h b/mapping.h index 760c33a8f..0a3a6fdcd 100644 --- a/mapping.h +++ b/mapping.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #ifndef MAPPING_H #define MAPPING_H diff --git a/mbox.c b/mbox.c index f5919a862..a0b2af29b 100644 --- a/mbox.c +++ b/mbox.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2010,2013 Michael R. Elkins - * + * * 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); } @@ -161,7 +161,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx) mutt_error (_("Mailbox is corrupt!")); return (-1); } - } + } else hdr->received = t - mutt_local_tz (t); @@ -309,12 +309,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, @@ -394,10 +394,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 @@ -713,7 +713,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. @@ -901,11 +901,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. @@ -918,16 +918,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)); @@ -946,7 +946,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; @@ -966,7 +966,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 @@ -995,17 +995,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); @@ -1015,7 +1015,7 @@ static int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint) } } } - + if (fclose (fp) != 0) { fp = NULL; @@ -1097,9 +1097,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); @@ -1169,7 +1169,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); @@ -1204,10 +1204,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) { @@ -1221,7 +1221,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); @@ -1274,7 +1274,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint) rc = -1; break; } - + if (rc == -1) { /* free the old headers */ diff --git a/menu.c b/menu.c index 67d9dd363..917e68594 100644 --- a/menu.c +++ b/menu.c @@ -240,9 +240,9 @@ static void print_enriched_string (int index, int attr, unsigned char *s, int do } } -static void menu_make_entry (char *s, int l, MUTTMENU *menu, int i) +static void menu_make_entry (char *s, int l, MUTTMENU *menu, int i) { - if (menu->dialog) + if (menu->dialog) { strncpy (s, menu->dialog[i], l); menu->current = -1; /* hide menubar */ @@ -361,12 +361,12 @@ void menu_redraw_motion (MUTTMENU *menu) { char buf[LONG_STRING]; - if (menu->dialog) + if (menu->dialog) { menu->redraw &= ~REDRAW_MOTION; return; } - + mutt_window_move (menu->indexwin, menu->oldcurrent + menu->offset - menu->top, 0); ATTRSET(menu->color (menu->oldcurrent)); @@ -431,9 +431,9 @@ void menu_redraw_current (MUTTMENU *menu) static void menu_redraw_prompt (MUTTMENU *menu) { - if (menu->dialog) + if (menu->dialog) { - if (option (OPTMSGERR)) + if (option (OPTMSGERR)) { mutt_sleep (1); unset_option (OPTMSGERR); @@ -454,13 +454,13 @@ void menu_check_recenter (MUTTMENU *menu) if (!option (OPTMENUMOVEOFF) && menu->max <= menu->pagelen) /* less entries than lines */ { - if (menu->top != 0) + if (menu->top != 0) { menu->top = 0; set_option (OPTNEEDREDRAW); } } - else + else { if (option (OPTMENUSCROLL) || (menu->pagelen <= 0) || (c < MenuContext)) { @@ -474,7 +474,7 @@ void menu_check_recenter (MUTTMENU *menu) if (menu->current < menu->top + c) menu->top -= (menu->pagelen - c) * ((menu->top + menu->pagelen - 1 - menu->current) / (menu->pagelen - c)) - c; else if ((menu->current >= menu->top + menu->pagelen - c)) - menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c; + menu->top += (menu->pagelen - c) * ((menu->current - menu->top) / (menu->pagelen - c)) - c; } } @@ -547,7 +547,7 @@ void menu_prev_line (MUTTMENU *menu) mutt_error (_("You cannot scroll up farther.")); } -/* +/* * pageup: jumplen == -pagelen * pagedown: jumplen == pagelen * halfup: jumplen == -pagelen/2 @@ -864,18 +864,18 @@ static int menu_dialog_translate_op (int i) { switch (i) { - case OP_NEXT_ENTRY: + case OP_NEXT_ENTRY: return OP_NEXT_LINE; - case OP_PREV_ENTRY: + case OP_PREV_ENTRY: return OP_PREV_LINE; - case OP_CURRENT_TOP: case OP_FIRST_ENTRY: + case OP_CURRENT_TOP: case OP_FIRST_ENTRY: return OP_TOP_PAGE; - case OP_CURRENT_BOTTOM: case OP_LAST_ENTRY: + case OP_CURRENT_BOTTOM: case OP_LAST_ENTRY: return OP_BOTTOM_PAGE; - case OP_CURRENT_MIDDLE: - return OP_MIDDLE_PAGE; + case OP_CURRENT_MIDDLE: + return OP_MIDDLE_PAGE; } - + return i; } @@ -913,10 +913,10 @@ int menu_redraw (MUTTMENU *menu) /* allow the caller to do any local configuration */ return (OP_REDRAW); } - + if (!menu->dialog) menu_check_recenter (menu); - + if (menu->redraw & REDRAW_STATUS) menu_redraw_status (menu); #ifdef USE_SIDEBAR @@ -929,10 +929,10 @@ int menu_redraw (MUTTMENU *menu) menu_redraw_motion (menu); else if (menu->redraw == REDRAW_CURRENT) menu_redraw_current (menu); - + if (menu->dialog) menu_redraw_prompt (menu); - + return OP_NULL; } @@ -956,19 +956,19 @@ int mutt_menuLoop (MUTTMENU *menu) unset_option (OPTMENUCALLER); return OP_NULL; } - - + + mutt_curs_set (0); if (menu_redraw (menu) == OP_REDRAW) return OP_REDRAW; - + menu->oldcurrent = menu->current; /* move the cursor out of the way */ - - + + if (option (OPTARROWCURSOR)) mutt_window_move (menu->indexwin, menu->current - menu->top + menu->offset, 2); else if (option (OPTBRAILLEFRIENDLY)) @@ -978,11 +978,11 @@ int mutt_menuLoop (MUTTMENU *menu) menu->indexwin->cols - 1); mutt_refresh (); - + /* try to catch dialog keys before ops */ if (menu->dialog && menu_dialog_dokey (menu, &i) == 0) return i; - + i = km_dokey (menu->menu); if (i == OP_TAG_PREFIX || i == OP_TAG_PREFIX_COND) { @@ -1030,7 +1030,7 @@ int mutt_menuLoop (MUTTMENU *menu) mutt_clear_error (); /* Convert menubar movement to scrolling */ - if (menu->dialog) + if (menu->dialog) i = menu_dialog_translate_op (i); switch (i) diff --git a/mh.c b/mh.c index 2918d808a..ef726c7f9 100644 --- a/mh.c +++ b/mh.c @@ -2,17 +2,17 @@ * Copyright (C) 1996-2002,2007,2009 Michael R. Elkins * Copyright (C) 1999-2005 Thomas Roessler * Copyright (C) 2010,2013 Michael R. Elkins - * + * * 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. @@ -680,7 +680,7 @@ 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; @@ -710,7 +710,7 @@ void maildir_parse_flags (HEADER * h, const char *path) h->deleted = 1; } break; - + default: *q++ = *p; break; @@ -718,7 +718,7 @@ void maildir_parse_flags (HEADER * h, const char *path) p++; } } - + if (q == h->maildir_flags) FREE (&h->maildir_flags); else if (q) @@ -751,7 +751,7 @@ static void maildir_update_mtime (CONTEXT * ctx) ctx->mtime = st.st_mtime; } -/* +/* * Actually parse a maildir message. This may also be used to fill * out a fake header structure generated by lazy maildir parsing. */ @@ -971,37 +971,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; @@ -1009,7 +1009,7 @@ static struct maildir* maildir_merge_lists (struct maildir *left, tail = tail->next; } - if (left) + if (left) { tail->next = left; } @@ -1061,7 +1061,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; } @@ -1070,7 +1070,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; @@ -1118,12 +1118,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; char fn[_POSIX_PATH_MAX]; int count; @@ -1440,7 +1440,7 @@ 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]; @@ -1496,7 +1496,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. * @@ -1569,23 +1569,23 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr /* * 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) @@ -1671,9 +1671,9 @@ static int maildir_commit_message (CONTEXT * ctx, MESSAGE * msg) return _maildir_commit_message (ctx, msg, NULL); } -/* +/* * commit a message to an MH folder. - * + * */ @@ -1721,9 +1721,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. */ @@ -1760,7 +1760,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. */ @@ -1802,7 +1802,7 @@ static int mh_rewrite_message (CONTEXT * ctx, int msgno) restore = 0; } - /* + /* * Try to move the new message to the old place. * (MH only.) * @@ -1811,7 +1811,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. @@ -2093,7 +2093,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; @@ -2101,13 +2101,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++; } @@ -2122,7 +2122,7 @@ void maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n) * end of list block if required. */ int context_changed = ctx->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 @@ -2143,7 +2143,7 @@ void maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n) * message. */ o->changed = 0; - + /* if the mailbox was not modified before we made these * changes, unset the changed flag since nothing needs to * be synchronized. @@ -2286,7 +2286,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); @@ -2296,7 +2296,7 @@ static int maildir_check_mailbox (CONTEXT * ctx, int *index_hint) return occult ? MUTT_REOPENED : (have_new ? MUTT_NEW_MAIL : 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 @@ -2325,14 +2325,14 @@ static int mh_check_mailbox (CONTEXT * ctx, int *index_hint) strfcpy (buf, ctx->path, sizeof (buf)); if (stat (buf, &st) == -1) return -1; - + /* create .mh_sequences when there isn't one. */ snprintf (buf, sizeof (buf), "%s/.mh_sequences", ctx->path); if ((i = stat (buf, &st_cur)) == -1 && errno == ENOENT) { char *tmp; FILE *fp = NULL; - + if (mh_mkstemp (ctx, &fp, &tmp) == 0) { safe_fclose (&fp); @@ -2557,7 +2557,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))) @@ -2569,7 +2569,7 @@ int mh_check_empty (const char *path) } } closedir (dp); - + return r; } diff --git a/mime.h b/mime.h index 30348726c..21e0ebd91 100644 --- a/mime.h +++ b/mime.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2010 Michael R. Elkins - * + * * 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. - */ + */ /* Content-Type */ enum diff --git a/mutt.h b/mutt.h index 1d1d3a9f3..7d0e99467 100644 --- a/mutt.h +++ b/mutt.h @@ -2,24 +2,24 @@ /* * Copyright (C) 1996-2002,2010,2013 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH - * + * * 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. - */ + */ #ifndef MUTT_H -#define MUTT_H +#define MUTT_H #include #include @@ -88,11 +88,11 @@ /* nifty trick I stole from ELM 2.5alpha. */ #ifdef MAIN_C -#define WHERE +#define WHERE #define INITVAL(x) = x #else #define WHERE extern -#define INITVAL(x) +#define INITVAL(x) #endif #define WHERE_DEFINED 1 @@ -246,7 +246,7 @@ enum #ifdef USE_NNTP MUTT_NEWSGROUPS, #endif - + /* Options for Mailcap lookup */ MUTT_EDIT, MUTT_COMPOSE, @@ -525,7 +525,7 @@ enum OPTCRYPTUSEPKA, /* PGP options */ - + OPTCRYPTAUTOSIGN, OPTCRYPTAUTOENCRYPT, OPTCRYPTAUTOPGP, @@ -769,9 +769,9 @@ typedef struct body char *filename; /* when sending a message, this is the file * to which this structure refers */ - char *d_filename; /* filename to be used for the + char *d_filename; /* filename to be used for the * content-disposition header. - * If NULL, filename is used + * If NULL, filename is used * instead. */ char *charset; /* charset of attached file */ @@ -791,7 +791,7 @@ typedef struct body time_t stamp; /* time stamp of last * encoding update. */ - + unsigned int type : 4; /* content-type primary type */ unsigned int encoding : 3; /* content-transfer-encoding */ unsigned int disposition : 2; /* content-disposition */ @@ -804,7 +804,7 @@ typedef struct body unsigned int deleted : 1; /* attachment marked for deletion */ unsigned int noconv : 1; /* don't do character set conversion */ - unsigned int force_charset : 1; + unsigned int force_charset : 1; /* send mode: don't adjust the character * set when in send-mode. */ @@ -860,7 +860,7 @@ typedef struct header * option. */ unsigned int xlabel_changed : 1; /* editable - used for syncing */ - + /* timezone of the sender of this message */ unsigned int zhours : 5; unsigned int zminutes : 6; @@ -879,7 +879,7 @@ typedef struct header size_t num_hidden; /* number of hidden messages in this view */ short recipient; /* user_is_recipient()'s return value, cached */ - + int pair; /* color-pair to use when displaying in the index */ time_t date_sent; /* time when the message was sent (UTC) */ @@ -893,7 +893,7 @@ typedef struct header ENVELOPE *env; /* envelope information */ BODY *content; /* list of MIME parts */ char *path; - + char *tree; /* character string to print thread tree */ THREAD *thread; @@ -912,7 +912,7 @@ typedef struct header void *data; /* driver-specific data */ void (*free_cb)(struct header *); /* driver-specific data free function */ #endif - + char *maildir_flags; /* unknown maildir flags */ } HEADER; @@ -973,7 +973,7 @@ typedef struct pattern_t int max; struct pattern_t *next; struct pattern_t *child; /* arguments to logical op */ - union + union { regex_t *rx; group_t *g; diff --git a/mutt_crypt.h b/mutt_crypt.h index f76c89dde..6fb14c531 100644 --- a/mutt_crypt.h +++ b/mutt_crypt.h @@ -1,21 +1,21 @@ /* * Copyright (C) 2003 Werner Koch * Copyright (C) 2004 g10code GmbH - * + * * 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 definitions and prototypes for the crypt functions. They are @@ -49,7 +49,7 @@ #define PGPENCRYPT (APPLICATION_PGP | ENCRYPT) #define PGPSIGN (APPLICATION_PGP | SIGN) #define PGPGOODSIGN (APPLICATION_PGP | GOODSIGN) -#define PGPKEY (APPLICATION_PGP | KEYBLOCK) +#define PGPKEY (APPLICATION_PGP | KEYBLOCK) #define PGPINLINE (APPLICATION_PGP | INLINE) #define SMIMEENCRYPT (APPLICATION_SMIME | ENCRYPT) @@ -131,9 +131,9 @@ void convert_to_7bit (BODY *); -/*-- crypt.c --*/ +/*-- crypt.c --*/ -/* Print the current time. */ +/* Print the current time. */ void crypt_current_time(STATE *s, char *app_name); /* Check out the type of encryption used and set the cached status @@ -144,7 +144,7 @@ int crypt_query (BODY *m); void crypt_extract_keys_from_messages (HEADER *h); /* Do a quick check to make sure that we can find all of the - encryption keys if the user has requested this service. + encryption keys if the user has requested this service. Return the list of keys in KEYLIST. If oppenc_mode is true, only keys that can be determined without prompting will be used. */ @@ -165,13 +165,13 @@ int crypt_valid_passphrase (int); int crypt_write_signed(BODY *a, STATE *s, const char *tempf); /* Obtain pointers to fingerprint or short or long key ID, if any. - + Upon return, at most one of return, *ppl and *pps pointers is non-NULL, indicating the longest fingerprint or ID found, if any. Return: Copy of fingerprint, if any, stripped of all spaces, else NULL. Must be FREE'd by caller. - *pphint Start of string to be passed to pgp_add_string_to_hints() or + *pphint Start of string to be passed to pgp_add_string_to_hints() or crypt_add_string_to_hints(). *ppl Start of long key ID if detected, else NULL. *pps Start of short key ID if detected, else NULL. */ diff --git a/mutt_curses.h b/mutt_curses.h index f9f737bed..6ea1232af 100644 --- a/mutt_curses.h +++ b/mutt_curses.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2012 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH - * + * * 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. - */ + */ #ifndef _MUTT_CURSES_H_ #define _MUTT_CURSES_H_ 1 diff --git a/mutt_idna.c b/mutt_idna.c index 8546ffd09..7603a02fb 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2003,2005,2008-2009 Thomas Roessler - * + * * 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" diff --git a/mutt_idna.h b/mutt_idna.h index 192e08db6..1681a12bb 100644 --- a/mutt_idna.h +++ b/mutt_idna.h @@ -1,20 +1,20 @@ /* * Copyright (C) 2003,2005 Thomas Roessler - * + * * 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. - */ + */ #ifndef _MUTT_IDNA_H # define _MUTT_IDNA_H diff --git a/mutt_menu.h b/mutt_menu.h index be4165d15..142bcdc34 100644 --- a/mutt_menu.h +++ b/mutt_menu.h @@ -59,28 +59,28 @@ typedef struct menu_t mutt_window_t *helpwin; mutt_window_t *messagewin; - /* Setting dialog != NULL overrides normal menu behavior. + /* Setting dialog != NULL overrides normal menu behavior. * In dialog mode menubar is hidden and prompt keys are checked before - * normal menu movement keys. This can cause problems with scrolling, if + * normal menu movement keys. This can cause problems with scrolling, if * prompt keys override movement keys. */ char **dialog; /* dialog lines themselves */ char *prompt; /* prompt for user, similar to mutt_multi_choice */ char *keys; /* keys used in the prompt */ - + /* callback to generate an index line for the requested element */ void (*make_entry) (char *, size_t, struct menu_t *, int); - + /* how to search the menu */ int (*search) (struct menu_t *, regex_t *re, int n); int (*tag) (struct menu_t *, int i, int m); - /* color pair to be used for the requested element + /* color pair to be used for the requested element * (default function returns ColorDefs[MT_COLOR_NORMAL]) */ int (*color) (int i); - + /* the following are used only by mutt_menuLoop() */ int top; /* entry that is the top of the current page */ int oldcurrent; /* for driver use only. */ diff --git a/mutt_regex.h b/mutt_regex.h index 1cc4a3e2e..896d677f8 100644 --- a/mutt_regex.h +++ b/mutt_regex.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ /* * A (more) generic interface to regular expression matching diff --git a/mutt_sasl.c b/mutt_sasl.c index f76e80c7e..abf9aa3f8 100644 --- a/mutt_sasl.c +++ b/mutt_sasl.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2008,2012,2014 Brendan Cully - * + * * 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 SASL helper routines */ @@ -77,7 +77,7 @@ static int getnameinfo_err(int ret) /* arbitrary. SASL will probably use a smaller buffer anyway. OTOH it's * been a while since I've had access to an SASL server which negotiated - * a protection buffer. */ + * a protection buffer. */ #define MUTT_SASL_MAXBUF 65536 #define IP_PORT_BUFLEN 1024 @@ -212,7 +212,7 @@ int mutt_sasl_client_new (CONNECTION* conn, sasl_conn_t** saslconn) } else mutt_debug (2, "SASL failed to get local IP address\n"); - + size = sizeof (remote); if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size)){ if (iptostring((struct sockaddr *)&remote, size, ipremoteport, @@ -226,7 +226,7 @@ int mutt_sasl_client_new (CONNECTION* conn, sasl_conn_t** saslconn) mutt_debug (2, "SASL local ip: %s, remote ip:%s\n", NONULL(plp), NONULL(prp)); - + rc = sasl_client_new (service, conn->account.host, plp, prp, mutt_sasl_get_callbacks (&conn->account), 0, saslconn); @@ -340,7 +340,7 @@ int mutt_sasl_interact (sasl_interact_t* interaction) * abstraction problem is that there is more in CONNECTION than there * needs to be. Ideally it would have only (void*)data and methods. */ -/* mutt_sasl_setup_conn: replace connection methods, sockdata with +/* mutt_sasl_setup_conn: replace connection methods, sockdata with * SASL wrappers, for protection layers. Also get ssf, as a fastpath * for the read/write methods. */ void mutt_sasl_setup_conn (CONNECTION* conn, sasl_conn_t* saslconn) @@ -427,7 +427,7 @@ static int mutt_sasl_cb_authname (void* context, int id, const char** result, return SASL_FAIL; *result = account->user; } - + if (len) *len = strlen (*result); @@ -523,7 +523,7 @@ static int mutt_sasl_conn_read (CONNECTION* conn, char* buf, size_t len) return olen; } - + conn->sockdata = sasldata->sockdata; sasldata->bpos = 0; @@ -607,7 +607,7 @@ static int mutt_sasl_conn_write (CONNECTION* conn, const char* buf, else /* just write using the underlying socket function */ rc = (sasldata->msasl_write) (conn, buf, len); - + conn->sockdata = sasldata; return rc; diff --git a/mutt_sasl.h b/mutt_sasl.h index 278117524..2588def32 100644 --- a/mutt_sasl.h +++ b/mutt_sasl.h @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2005,2008 Brendan Cully - * + * * 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 SASL helper routines */ @@ -31,7 +31,7 @@ int mutt_sasl_interact (sasl_interact_t*); void mutt_sasl_setup_conn (CONNECTION*, sasl_conn_t*); void mutt_sasl_done (void); -typedef struct +typedef struct { sasl_conn_t* saslconn; const sasl_ssf_t* ssf; diff --git a/mutt_socket.c b/mutt_socket.c index 2b2af7f26..0021edc98 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -2,21 +2,21 @@ * Copyright (C) 1998,2000 Michael R. Elkins * Copyright (C) 1999-2006,2008 Brendan Cully * Copyright (C) 1999-2000 Tommi Komulainen - * + * * 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" @@ -56,7 +56,7 @@ static int socket_connect (int fd, struct sockaddr* sa); static CONNECTION* socket_new_conn (void); /* Wrappers */ -int mutt_socket_open (CONNECTION* conn) +int mutt_socket_open (CONNECTION* conn) { int rc; @@ -124,7 +124,7 @@ int mutt_socket_write_d (CONNECTION *conn, const char *buf, int len, int dbg) if (len < 0) len = mutt_strlen (buf); - + while (sent < len) { if ((rc = conn->conn_write (conn, buf + sent, len - sent)) < 0) @@ -139,7 +139,7 @@ int mutt_socket_write_d (CONNECTION *conn, const char *buf, int len, int dbg) if (rc < len - sent) mutt_debug (3, "mutt_socket_write: short write (%d of %d bytes)\n", rc, len - sent); - + sent += rc; } @@ -214,7 +214,7 @@ int mutt_socket_readln_d (char* buf, size_t buflen, CONNECTION* conn, int dbg) buf[i] = '\0'; mutt_debug (dbg, "%d< %s\n", conn->fd, buf); - + /* number of bytes read, not strlen */ return i + 1; } @@ -286,7 +286,7 @@ CONNECTION* mutt_conn_find (const CONNECTION* start, const ACCOUNT* account) if (Tunnel && *Tunnel) mutt_tunnel_socket_setup (conn); - else if (account->flags & MUTT_ACCT_SSL) + else if (account->flags & MUTT_ACCT_SSL) { #if defined(USE_SSL) if (mutt_ssl_socket_setup (conn) < 0) @@ -329,7 +329,7 @@ static int socket_preconnect (void) save_errno = errno; mutt_perror (_("Preconnect command failed.")); mutt_sleep (1); - + return save_errno; } } @@ -354,7 +354,7 @@ static int socket_connect (int fd, struct sockaddr* sa) mutt_debug (1, "Unknown address family!\n"); return -1; } - + if (ConnectTimeout > 0) alarm (ConnectTimeout); @@ -452,7 +452,7 @@ int raw_socket_poll (CONNECTION* conn) FD_ZERO (&rfds); FD_SET (conn->fd, &rfds); - + return select (conn->fd + 1, &rfds, NULL, NULL, &tv); } @@ -462,7 +462,7 @@ int raw_socket_open (CONNECTION* conn) int fd; char *host_idna = NULL; - + #ifdef HAVE_GETADDRINFO /* --- IPv4/6 --- */ @@ -483,7 +483,7 @@ int raw_socket_open (CONNECTION* conn) hints.ai_socktype = SOCK_STREAM; snprintf (port, sizeof (port), "%d", conn->account.port); - + # ifdef HAVE_LIBIDN if (idna_to_ascii_lz (conn->account.host, &host_idna, 1) != IDNA_SUCCESS) { @@ -496,7 +496,7 @@ int raw_socket_open (CONNECTION* conn) if (!option(OPTNOCURSES)) mutt_message (_("Looking up %s..."), conn->account.host); - + rc = getaddrinfo (host_idna, port, &hints, &res); # ifdef HAVE_LIBIDN @@ -511,7 +511,7 @@ int raw_socket_open (CONNECTION* conn) } if (!option(OPTNOCURSES)) - mutt_message (_("Connecting to %s..."), conn->account.host); + mutt_message (_("Connecting to %s..."), conn->account.host); rc = -1; for (cur = res; cur != NULL; cur = cur->ai_next) @@ -564,12 +564,12 @@ int raw_socket_open (CONNECTION* conn) if (! he) { mutt_error (_("Could not find the host \"%s\""), conn->account.host); - + return -1; } if (!option(OPTNOCURSES)) - mutt_message (_("Connecting to %s..."), conn->account.host); + mutt_message (_("Connecting to %s..."), conn->account.host); rc = -1; for (i = 0; he->h_addr_list[i] != NULL; i++) @@ -598,6 +598,6 @@ int raw_socket_open (CONNECTION* conn) mutt_sleep (2); return -1; } - + return 0; } diff --git a/mutt_socket.h b/mutt_socket.h index b8c535ca7..0cbfd1158 100644 --- a/mutt_socket.h +++ b/mutt_socket.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1998 Brandon Long * Copyright (C) 1999-2005 Brendan Cully - * + * * 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. - */ + */ #ifndef _MUTT_SOCKET_H_ #define _MUTT_SOCKET_H_ 1 diff --git a/mutt_ssl.h b/mutt_ssl.h index d579ab487..ad0e74c98 100644 --- a/mutt_ssl.h +++ b/mutt_ssl.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1999-2000 Tommi Komulainen - * + * * 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. - */ + */ #ifndef _MUTT_SSL_H_ #define _MUTT_SSL_H_ 1 diff --git a/muttlib.c b/muttlib.c index afff1373d..94cea9d4c 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2007,2010,2013 Michael R. Elkins * Copyright (C) 1999-2008 Thomas Roessler - * + * * 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" @@ -70,7 +70,7 @@ static const char *xdg_defaults[] = BODY *mutt_new_body (void) { BODY *p = safe_calloc (1, sizeof (BODY)); - + p->disposition = DISPATTACH; p->use_disp = 1; return (p); @@ -78,7 +78,7 @@ BODY *mutt_new_body (void) /* Modified by blong to accept a "suggestion" for file name. If - * that file exists, then construct one with unique name but + * that file exists, then construct one with unique name but * keep any extension. This might fail, I guess. * Renamed to mutt_adv_mktemp so I only have to change where it's * called, and not all possible cases. @@ -118,7 +118,7 @@ int mutt_copy_body (FILE *fp, BODY **tgt, BODY *src) BODY *b; PARAMETER *par, **ppar; - + short use_disp; if (src->filename) @@ -135,7 +135,7 @@ int mutt_copy_body (FILE *fp, BODY **tgt, BODY *src) mutt_adv_mktemp (tmp, sizeof (tmp)); if (mutt_save_attachment (fp, src, tmp, 0, NULL) == -1) return -1; - + *tgt = mutt_new_body (); b = *tgt; @@ -160,13 +160,13 @@ int mutt_copy_body (FILE *fp, BODY **tgt, BODY *src) b->d_filename = safe_strdup (src->filename); b->description = safe_strdup (b->description); - /* + /* * we don't seem to need the HEADER structure currently. * XXX - this may change in the future */ if (b->hdr) b->hdr = NULL; - + /* copy parameters */ for (par = b->parameter, ppar = &b->parameter; par; ppar = &(*ppar)->next, par = par->next) { @@ -176,7 +176,7 @@ int mutt_copy_body (FILE *fp, BODY **tgt, BODY *src) } mutt_stamp_attachment (b); - + return 0; } @@ -189,7 +189,7 @@ void mutt_free_body (BODY **p) while (a) { b = a; - a = a->next; + a = a->next; if (b->parameter) mutt_free_parameter (&b->parameter); @@ -252,7 +252,7 @@ LIST *mutt_add_list (LIST *head, const char *data) LIST *mutt_add_list_n (LIST *head, const void *data, size_t len) { LIST *tmp; - + for (tmp = head; tmp && tmp->next; tmp = tmp->next) ; if (tmp) @@ -262,7 +262,7 @@ LIST *mutt_add_list_n (LIST *head, const void *data, size_t len) } else head = tmp = safe_malloc (sizeof (LIST)); - + tmp->data = safe_malloc (len); if (len) memcpy (tmp->data, data, len); @@ -351,7 +351,7 @@ int mutt_remove_from_rx_list (RX_LIST **l, const char *str) void mutt_free_list (LIST **list) { LIST *p; - + if (!list) return; while (*list) { @@ -372,7 +372,7 @@ LIST *mutt_copy_list (LIST *p) t->data = safe_strdup (p->data); t->next = NULL; if (l) - { + { r->next = t; r = r->next; } @@ -464,11 +464,11 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) char tmp[_POSIX_PATH_MAX]; char *t; - char *tail = ""; + char *tail = ""; int recurse = 0; - - do + + do { recurse = 0; @@ -484,7 +484,7 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) else { struct passwd *pw; - if ((t = strchr (s + 1, '/'))) + if ((t = strchr (s + 1, '/'))) *t = 0; if ((pw = getpwnam (s + 1))) @@ -509,9 +509,9 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) } } break; - + case '=': - case '+': + case '+': { #ifdef USE_IMAP /* if folder = {host} or imap[s]://host/: don't append slash */ @@ -530,18 +530,18 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) strfcpy (p, NONULL (Maildir), sizeof (p)); else snprintf (p, sizeof (p), "%s/", NONULL (Maildir)); - + tail = s + 1; } break; - + /* elm compatibility, @ expands alias to user name */ - + case '@': { HEADER *h; ADDRESS *alias; - + if ((alias = mutt_lookup_alias (s + 1))) { h = mutt_new_header(); @@ -553,26 +553,26 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) /* Avoid infinite recursion if the resulting folder starts with '@' */ if (*p != '@') recurse = 1; - + tail = ""; } } break; - + case '>': { strfcpy (p, NONULL(Inbox), sizeof (p)); tail = s + 1; } break; - + case '<': { strfcpy (p, NONULL(Outbox), sizeof (p)); tail = s + 1; } break; - + case '!': { if (*(s+1) == '!') @@ -580,22 +580,22 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) strfcpy (p, NONULL(LastFolder), sizeof (p)); tail = s + 2; } - else + else { strfcpy (p, NONULL(Spoolfile), sizeof (p)); tail = s + 1; } } break; - + case '-': { strfcpy (p, NONULL(LastFolder), sizeof (p)); tail = s + 1; } break; - - case '^': + + case '^': { strfcpy (p, NONULL(CurrentFolder), sizeof (p)); tail = s + 1; @@ -616,7 +616,7 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) } else snprintf (tmp, sizeof (tmp), "%s%s", p, tail); - + strfcpy (s, tmp, slen); } while (recurse); @@ -633,7 +633,7 @@ char *_mutt_expand_path (char *s, size_t slen, int rx) /* Extract the real name from /etc/passwd's GECOS field. * When set, honor the regular expression in GecosMask, - * otherwise assume that the GECOS field is a + * otherwise assume that the GECOS field is a * comma-separated list. * Replace "&" by a capitalized version of the user's login * name. @@ -645,16 +645,16 @@ char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw) size_t pwnl; int idx; char *p; - - if (!pw || !pw->pw_gecos) + + if (!pw || !pw->pw_gecos) return NULL; memset (dest, 0, destlen); - + if (GecosMask.rx) { if (regexec (GecosMask.rx, pw->pw_gecos, 1, pat_match, 0) == 0) - strfcpy (dest, pw->pw_gecos + pat_match[0].rm_so, + strfcpy (dest, pw->pw_gecos + pat_match[0].rm_so, MIN (pat_match[0].rm_eo - pat_match[0].rm_so + 1, destlen)); } else if ((p = strchr (pw->pw_gecos, ','))) @@ -674,10 +674,10 @@ char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw) dest[idx] = toupper ((unsigned char) dest[idx]); } } - + return dest; } - + char *mutt_get_parameter (const char *s, PARAMETER *p) { @@ -697,7 +697,7 @@ void mutt_set_parameter (const char *attribute, const char *value, PARAMETER **p mutt_delete_parameter (attribute, p); return; } - + for(q = *p; q; q = q->next) { if (ascii_strcasecmp (attribute, q->attribute) == 0) @@ -706,7 +706,7 @@ void mutt_set_parameter (const char *attribute, const char *value, PARAMETER **p return; } } - + q = mutt_new_parameter(); q->attribute = safe_strdup(attribute); q->value = safe_strdup(value); @@ -717,7 +717,7 @@ void mutt_set_parameter (const char *attribute, const char *value, PARAMETER **p void mutt_delete_parameter (const char *attribute, PARAMETER **p) { PARAMETER *q; - + for (q = *p; q; p = &q->next, q = q->next) { if (ascii_strcasecmp (attribute, q->attribute) == 0) @@ -758,7 +758,7 @@ int mutt_is_text_part (BODY *b) { int t = b->type; char *s = b->subtype; - + if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)) return 0; @@ -845,7 +845,7 @@ void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra) { MOVE_ELEM(in_reply_to); } - + /* real_subj is subordinate to subject */ if (!base->subject) { @@ -863,7 +863,7 @@ void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra) MOVE_ELEM(spam); MOVE_ELEM(userhdrs); #undef MOVE_ELEM - + mutt_free_envelope(extra); } @@ -1017,7 +1017,7 @@ void mutt_pretty_mailbox (char *s, size_t buflen) } *q = 0; } - else if (strstr (p, "..") && + else if (strstr (p, "..") && (scheme == U_UNKNOWN || scheme == U_FILE) && realpath (p, tmp)) strfcpy (p, tmp, buflen - (p - s)); @@ -1059,7 +1059,7 @@ void mutt_pretty_size (char *s, size_t len, LOFF_T n) void mutt_expand_file_fmt (char *dest, size_t destlen, const char *fmt, const char *src) { char tmp[LONG_STRING]; - + mutt_quote_filename (tmp, sizeof (tmp), src); mutt_expand_fmt (dest, destlen, fmt, tmp); } @@ -1073,10 +1073,10 @@ void mutt_expand_fmt (char *dest, size_t destlen, const char *fmt, const char *s slen = mutt_strlen (src); destlen--; - + for (p = fmt, d = dest; destlen && *p; p++) { - if (*p == '%') + if (*p == '%') { switch (p[1]) { @@ -1092,7 +1092,7 @@ void mutt_expand_fmt (char *dest, size_t destlen, const char *fmt, const char *s p++; break; default: - *d++ = *p; + *d++ = *p; destlen--; break; } @@ -1103,20 +1103,20 @@ void mutt_expand_fmt (char *dest, size_t destlen, const char *fmt, const char *s destlen--; } } - + *d = '\0'; - + if (!found && destlen > 0) { safe_strcat (dest, destlen, " "); safe_strcat (dest, destlen, src); } - + } /* return 0 on success, -1 on abort, 1 on error */ int mutt_check_overwrite (const char *attname, const char *path, - char *fname, size_t flen, int *append, char **directory) + char *fname, size_t flen, int *append, char **directory) { int rc = 0; char tmp[_POSIX_PATH_MAX]; @@ -1163,7 +1163,7 @@ int mutt_check_overwrite (const char *attname, const char *path, return (-1); mutt_concat_path (fname, path, tmp, flen); } - + if (*append == 0 && access (fname, F_OK) == 0) { switch (mutt_multi_choice @@ -1686,30 +1686,30 @@ void mutt_FormatString (char *dest, /* output buffer */ { short tolower = 0; short nodots = 0; - - while (ch == '_' || ch == ':') + + while (ch == '_' || ch == ':') { if (ch == '_') tolower = 1; - else if (ch == ':') + else if (ch == ':') nodots = 1; - + ch = *src++; } - + /* use callback function to handle this case */ src = callback (buf, sizeof (buf), col, cols, ch, src, prefix, ifstring, elsestring, data, flags); if (tolower) mutt_strlower (buf); - if (nodots) + if (nodots) { char *p = buf; for (; *p; p++) if (*p == '.') *p = '_'; } - + if ((len = mutt_strlen (buf)) + wlen > destlen) len = mutt_wstr_trunc (buf, destlen - wlen, cols - col, NULL); @@ -1917,7 +1917,7 @@ int state_printf (STATE *s, const char *fmt, ...) va_start (ap, fmt); rv = vfprintf (s->fpout, fmt, ap); va_end (ap); - + return rv; } @@ -1971,7 +1971,7 @@ void mutt_display_sanitize (char *s) *s = '?'; } } - + void mutt_sleep (short s) { if (SleepTime > s) @@ -1987,7 +1987,7 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st) struct utimbuf utim; struct stat _st; time_t mtime; - + if (!st) { if (stat (f, &_st) == -1) @@ -2002,7 +2002,7 @@ time_t mutt_decrease_mtime (const char *f, struct stat *st) utim.modtime = mtime; utime (f, &utim); } - + return mtime; } @@ -2060,7 +2060,7 @@ void mutt_free_regexp (REGEXP **pp) void mutt_free_rx_list (RX_LIST **list) { RX_LIST *p; - + if (!list) return; while (*list) { @@ -2074,7 +2074,7 @@ void mutt_free_rx_list (RX_LIST **list) void mutt_free_replace_list (REPLACE_LIST **list) { REPLACE_LIST *p; - + if (!list) return; while (*list) { @@ -2089,7 +2089,7 @@ void mutt_free_replace_list (REPLACE_LIST **list) int mutt_match_rx_list (const char *s, RX_LIST *l) { if (!s) return 0; - + for (; l; l = l->next) { if (regexec (l->rx->rx, s, (size_t) 0, (regmatch_t *) 0, (int) 0) == 0) diff --git a/mx.c b/mx.c index 65d2d850f..f38a2f34f 100644 --- a/mx.c +++ b/mx.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2002,2010,2013 Michael R. Elkins * Copyright (C) 1999-2003 Thomas Roessler - * + * * 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" @@ -112,7 +112,7 @@ struct mx_ops* mx_get_ops (int magic) #define mutt_is_spool(s) (mutt_strcmp (Spoolfile, s) == 0) #ifdef USE_DOTLOCK -/* parameters: +/* parameters: * path - file to lock * retry - should retry if unable to lock? */ @@ -124,12 +124,12 @@ static int invoke_dotlock (const char *path, int dummy, int flags, int retry) char cmd[LONG_STRING + _POSIX_PATH_MAX]; char f[SHORT_STRING + _POSIX_PATH_MAX]; char r[SHORT_STRING]; - + if (flags & DL_FL_RETRY) snprintf (r, sizeof (r), "-r %d ", retry ? MAXLOCKATTEMPT : 0); - + mutt_quote_filename (f, sizeof (f), path); - + snprintf (cmd, sizeof (cmd), "%s %s%s%s%s%s%s%s", NONULL (MuttDotlock), @@ -140,11 +140,11 @@ static int invoke_dotlock (const char *path, int dummy, int flags, int retry) flags & DL_FL_UNLINK ? "-d " : "", flags & DL_FL_RETRY ? r : "", f); - + return mutt_system (cmd); } -#else +#else #define invoke_dotlock dotlock_invoke @@ -163,7 +163,7 @@ retry_lock: if (!option (OPTNOCURSES)) { char msg[LONG_STRING]; - + snprintf(msg, sizeof(msg), _("Lock count exceeded, remove lock for %s?"), path); if(retry && mutt_yesorno(msg, MUTT_YES) == MUTT_YES) @@ -173,7 +173,7 @@ retry_lock: mutt_clear_error (); goto retry_lock; } - } + } else { mutt_error (_("Can't dotlock %s.\n"), path); @@ -184,7 +184,7 @@ retry_lock: static int undotlock_file (const char *path, int fd) { - return (invoke_dotlock(path, fd, DL_FL_USEPRIV | DL_FL_UNLOCK, 0) == DL_EX_OK ? + return (invoke_dotlock(path, fd, DL_FL_USEPRIV | DL_FL_UNLOCK, 0) == DL_EX_OK ? 0 : -1); } @@ -206,7 +206,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) #ifdef USE_FCNTL struct flock lck; - + memset (&lck, 0, sizeof (struct flock)); lck.l_type = excl ? F_WRLCK : F_RDLCK; lck.l_whence = SEEK_SET; @@ -224,7 +224,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) if (fstat (fd, &sb) != 0) sb.st_size = 0; - + if (count == 0) prev_sb = sb; @@ -257,7 +257,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) if (fstat(fd, &sb) != 0) sb.st_size = 0; - + if (count == 0) prev_sb = sb; @@ -318,7 +318,7 @@ int mx_unlock_file (const char *path, int fd, int dot) if (dot) undotlock_file (path, fd); #endif - + return 0; } @@ -721,7 +721,7 @@ void mx_fastclose_mailbox (CONTEXT *ctx) int i; struct utimbuf ut; - if(!ctx) + if(!ctx) return; /* fix up the times so buffy won't get confused */ @@ -752,7 +752,7 @@ void mx_fastclose_mailbox (CONTEXT *ctx) FREE (&ctx->path); FREE (&ctx->realpath); FREE (&ctx->pattern); - if (ctx->limit_pattern) + if (ctx->limit_pattern) mutt_pattern_free (&ctx->limit_pattern); safe_fclose (&ctx->fp); memset (ctx, 0, sizeof (CONTEXT)); @@ -878,7 +878,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) for (i = 0; i < ctx->msgcount; i++) { - if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read + if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) read_msgs++; #ifdef USE_SIDEBAR @@ -916,7 +916,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) } } - /* + /* * There is no point in asking whether or not to purge if we are * just marking messages as "trash". */ @@ -949,20 +949,20 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) #ifdef USE_IMAP /* try to use server-side copy first */ i = 1; - + if (ctx->magic == MUTT_IMAP && mx_is_imap (mbox)) { /* tag messages for moving, and clear old tags, if any */ for (i = 0; i < ctx->msgcount; i++) if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted - && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) + && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) ctx->hdrs[i]->tagged = 1; else ctx->hdrs[i]->tagged = 0; - + i = imap_copy_messages (ctx, NULL, mbox, 1); } - + if (i == 0) /* success */ mutt_clear_error (); else if (i == -1) /* horrible error, bail */ @@ -997,10 +997,10 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) } } } - + mx_close_mailbox (&f, NULL); } - + } else if (!ctx->changed && ctx->deleted == 0) { @@ -1090,7 +1090,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) void mx_update_tables(CONTEXT *ctx, int committing) { int i, j; - + /* update memory to reflect the new state of the mailbox */ ctx->vcount = 0; ctx->vsize = 0; @@ -1126,7 +1126,7 @@ void mx_update_tables(CONTEXT *ctx, int committing) ctx->hdrs[j]->changed = 0; else if (ctx->hdrs[j]->changed) ctx->changed++; - + if (!committing || (ctx->magic == MUTT_MAILDIR && option (OPTMAILDIRTRASH))) { if (ctx->hdrs[j]->deleted) @@ -1138,11 +1138,11 @@ void mx_update_tables(CONTEXT *ctx, int committing) if (ctx->hdrs[j]->flagged) ctx->flagged++; if (!ctx->hdrs[j]->read) - { + { ctx->unread++; if (!ctx->hdrs[j]->old) ctx->new++; - } + } j++; } @@ -1272,7 +1272,7 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint) } mutt_sleep (0); - + if (ctx->msgcount == ctx->deleted && (ctx->magic == MUTT_MBOX || ctx->magic == MUTT_MMDF) && !mutt_is_spool (ctx->path) && !option (OPTSAVEEMPTY)) @@ -1283,9 +1283,9 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint) } /* if we haven't deleted any messages, we don't need to resort */ - /* ... except for certain folder formats which need "unsorted" + /* ... except for certain folder formats which need "unsorted" * sort order in order to synchronize folders. - * + * * MH and maildir are safe. mbox-style seems to need re-sorting, * at least with the new threading code. */ @@ -1436,14 +1436,14 @@ void mx_alloc_memory (CONTEXT *ctx) { int i; size_t s = MAX (sizeof (HEADER *), sizeof (int)); - + if ((ctx->hdrmax + 25) * s < ctx->hdrmax * s) { mutt_error (_("Integer overflow -- can't allocate memory.")); sleep (1); mutt_exit (1); } - + if (ctx->hdrs) { safe_realloc (&ctx->hdrs, sizeof (HEADER *) * (ctx->hdrmax += 25)); @@ -1492,7 +1492,7 @@ void mx_update_context (CONTEXT *ctx, int new_messages) { HEADER *h2; - if (!ctx->id_hash) + if (!ctx->id_hash) ctx->id_hash = mutt_make_id_hash (ctx); h2 = hash_find (ctx->id_hash, h->env->supersedes); @@ -1501,7 +1501,7 @@ void mx_update_context (CONTEXT *ctx, int new_messages) if (h2) { h2->superseded = 1; - if (option (OPTSCORE)) + if (option (OPTSCORE)) mutt_score_message (ctx, h2, 1); } } @@ -1513,7 +1513,7 @@ void mx_update_context (CONTEXT *ctx, int new_messages) hash_insert (ctx->subj_hash, h->env->real_subj, h); mutt_label_hash_add (ctx, h); - if (option (OPTSCORE)) + if (option (OPTSCORE)) mutt_score_message (ctx, h, 0); if (h->changed) diff --git a/mx.h b/mx.h index c5a968610..97255f1c5 100644 --- a/mx.h +++ b/mx.h @@ -6,16 +6,16 @@ * 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 header file contains prototypes for internal functions used by the diff --git a/myvar.h b/myvar.h index 3f2175bbd..7579a48e0 100644 --- a/myvar.h +++ b/myvar.h @@ -3,12 +3,12 @@ * 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. diff --git a/pager.c b/pager.c index 2b12c3a65..84eccedb8 100644 --- a/pager.c +++ b/pager.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2007,2010,2012-2013 Michael R. Elkins - * + * * 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" @@ -238,7 +238,7 @@ resolve_color (struct line_t *lineInfo, int n, int cnt, int flags, int special, color = (lineInfo[m].syntax)[i].color; break; } - /* don't break here, as cnt might be + /* don't break here, as cnt might be * in the next chunk as well */ } } @@ -288,11 +288,11 @@ resolve_color (struct line_t *lineInfo, int n, int cnt, int flags, int special, else color ^= A_UNDERLINE; } - else if (a->attr & ANSI_REVERSE) + else if (a->attr & ANSI_REVERSE) { color ^= A_REVERSE; } - else if (a->attr & ANSI_BLINK) + else if (a->attr & ANSI_BLINK) { color ^= A_BLINK; } @@ -323,7 +323,7 @@ append_line (struct line_t *lineInfo, int n, int cnt) if (lineInfo[m].continuation == 0) break; (lineInfo[n+1].syntax)[0].first = m; - (lineInfo[n+1].syntax)[0].last = (lineInfo[n].continuation) ? + (lineInfo[n+1].syntax)[0].last = (lineInfo[n].continuation) ? cnt + (lineInfo[n].syntax)[0].last : cnt; } @@ -515,7 +515,7 @@ classify_quote (struct q_class_t **QuoteList, const char *qptr, else { /* case 2: try subclassing the current top level node */ - + /* tmp != NULL means we already found a shorter prefix at case 1 */ if (tmp == NULL && mutt_strncmp (qptr, q_list->prefix, q_list->length) == 0) { @@ -546,7 +546,7 @@ classify_quote (struct q_class_t **QuoteList, const char *qptr, tmp->prefix = safe_calloc (1, length + 1); strncpy (tmp->prefix, qptr, length); tmp->length = length; - + /* replace q_list by tmp */ if (q_list->next) { @@ -569,7 +569,7 @@ classify_quote (struct q_class_t **QuoteList, const char *qptr, /* q_list has no siblings */ q_list->next = NULL; q_list->prev = NULL; - + index = q_list->index; /* tmp should be the return class too */ @@ -788,7 +788,7 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, if (lineInfo[i].chunks) { lineInfo[i].chunks = 0; - safe_realloc (&(lineInfo[n].syntax), + safe_realloc (&(lineInfo[n].syntax), sizeof (struct syntax_t)); } lineInfo[i++].type = MT_COLOR_SIGNATURE; @@ -838,7 +838,7 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, lineInfo[n].type = MT_COLOR_NORMAL; /* body patterns */ - if (lineInfo[n].type == MT_COLOR_NORMAL || + if (lineInfo[n].type == MT_COLOR_NORMAL || lineInfo[n].type == MT_COLOR_QUOTED) { size_t nl; @@ -876,7 +876,7 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, break; } if (++(lineInfo[n].chunks) > 1) - safe_realloc (&(lineInfo[n].syntax), + safe_realloc (&(lineInfo[n].syntax), (lineInfo[n].chunks) * sizeof (struct syntax_t)); } i = lineInfo[n].chunks - 1; @@ -982,7 +982,7 @@ static int is_ansi (unsigned char *buf) static int check_attachment_marker (char *p) { char *q = AttachmentMarker; - + for (;*p == *q && *q && *p && *q != '\a' && *p != '\a'; p++, q++) ; return (int) (*p - *q); @@ -1013,7 +1013,7 @@ static int grok_ansi(unsigned char *buf, int pos, ansi_attr *a) { a->attr |= ANSI_BOLD; pos += 2; - } + } else if (buf[pos] == '4' && (pos+1 == x || buf[pos+1] == ';')) { a->attr |= ANSI_UNDERLINE; @@ -1061,7 +1061,7 @@ static int grok_ansi(unsigned char *buf, int pos, ansi_attr *a) a->bg = buf[pos+1] - '0'; pos += 3; } - else + else { while (pos < x && buf[pos] != ';') pos++; pos++; @@ -1083,8 +1083,8 @@ trim_incomplete_mbyte(unsigned char *buf, size_t len) for (; len > 0; buf += k, len -= k) { k = mbrtowc (NULL, (char *) buf, len, &mbstate); - if (k == (size_t)(-2)) - break; + if (k == (size_t)(-2)) + break; else if (k == (size_t)(-1) || k == 0) { if (k == (size_t)(-1)) @@ -1124,7 +1124,7 @@ fill_buffer (FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf, * certain versions of glibc. Trim them if necessary. */ if (b_read == *blen - 2) b_read -= trim_incomplete_mbyte(*buf, b_read); - + /* copy "buf" to "fmt", but without bold and underline controls */ p = *buf; q = *fmt; @@ -1204,7 +1204,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, /* is anything left to do? */ if (ch >= cnt) break; - + k = mbrtowc (&wc, (char *)buf+ch, cnt-ch, &mbstate); if (k == (size_t)(-2) || k == (size_t)(-1)) { @@ -1368,7 +1368,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, */ static int -display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, +display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, int *last, int *max, int flags, struct q_class_t **QuoteList, int *q_level, int *force_redraw, regex_t *SearchRE, mutt_window_t *pager_window) @@ -1431,7 +1431,7 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, flags = 0; /* MUTT_NOSHOW */ } - /* At this point, (*lineInfo[n]).quote may still be undefined. We + /* At this point, (*lineInfo[n]).quote may still be undefined. We * don't want to compute it every time MUTT_TYPES is set, since this * would slow down the "bottom" function unacceptably. A compromise * solution is hence to call regexec() again, just to find out the @@ -1453,7 +1453,7 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, force_redraw, q_level); } - if ((flags & MUTT_SEARCH) && !(*lineInfo)[n].continuation && (*lineInfo)[n].search_cnt == -1) + if ((flags & MUTT_SEARCH) && !(*lineInfo)[n].continuation && (*lineInfo)[n].search_cnt == -1) { if (fill_buffer (f, last_pos, (*lineInfo)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0) { @@ -1498,7 +1498,7 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, goto out; /* fake display */ } - if ((b_read = fill_buffer (f, last_pos, (*lineInfo)[n].offset, &buf, &fmt, + if ((b_read = fill_buffer (f, last_pos, (*lineInfo)[n].offset, &buf, &fmt, &buflen, &buf_ready)) < 0) { if (change_last) @@ -1534,7 +1534,7 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, } if (!(flags & MUTT_PAGER_NSKIP)) /* skip leading blanks on the next line too */ - while (*buf_ptr == ' ' || *buf_ptr == '\t') + while (*buf_ptr == ' ' || *buf_ptr == '\t') buf_ptr++; } @@ -1570,7 +1570,7 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, /* end the last color pattern (needed by S-Lang) */ if (special || (col != pager_window->cols && (flags & (MUTT_SHOWCOLOR | MUTT_SEARCH)))) resolve_color (*lineInfo, n, vch, flags, 0, &a); - + /* * Fill the blank space at the end of the line with the prevailing color. * ncurses does an implicit clrtoeol() when you do addch('\n') so we have @@ -1659,7 +1659,7 @@ void mutt_clear_pager_position (void) can be distinguished by whether or not ``hdr'' is NULL. The ``hdr'' arg is there so that we can do operations on the current message without the need to pop back out to the main-menu. */ -int +int mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) { static char searchbuf[STRING] = ""; @@ -1903,7 +1903,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) while (lines < pager_window->rows && lineInfo[curline].offset <= sb.st_size - 1) { - if (display_line (fp, &last_pos, &lineInfo, curline, &lastLine, + if (display_line (fp, &last_pos, &lineInfo, curline, &lastLine, &maxLine, (flags & MUTT_DISPLAYFLAGS) | hideQuoted | SearchFlag | (flags & MUTT_PAGER_NOWRAP), &QuoteList, &q_level, &force_redraw, &SearchRE, @@ -1985,7 +1985,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) /* print out the index status bar */ menu_status_line (buffer, sizeof (buffer), index, NONULL(Status)); - + mutt_window_move (index_status_window, 0, 0); SETCOLOR (MT_COLOR_STATUS); mutt_draw_statusline (index_status_window->cols, buffer, sizeof (buffer)); @@ -2014,7 +2014,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) } else OldHdr = NULL; - + ch = km_dokey (MENU_PAGER); if (ch != -1) { @@ -2280,7 +2280,7 @@ search_next: /* searching forward */ for (i = wrapped ? 0 : topline + searchctx + 1; i < lastLine; i++) { - if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && + if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && !lineInfo[i].continuation && lineInfo[i].search_cnt > 0) break; } @@ -2301,8 +2301,8 @@ search_next: /* searching backward */ for (i = wrapped ? lastLine : topline + searchctx - 1; i >= 0; i--) { - if ((!hideQuoted || (has_types && - lineInfo[i].type != MT_COLOR_QUOTED)) && + if ((!hideQuoted || (has_types && + lineInfo[i].type != MT_COLOR_QUOTED)) && !lineInfo[i].continuation && lineInfo[i].search_cnt > 0) break; } @@ -2354,10 +2354,10 @@ search_next: goto search_next; } } - + if (!buffer[0]) break; - + strfcpy (searchbuf, buffer, sizeof (searchbuf)); /* leave SearchBack alone if ch == OP_SEARCH_NEXT */ @@ -2396,7 +2396,7 @@ search_next: SearchCompiled = 1; /* update the search pointers */ i = 0; - while (display_line (fp, &last_pos, &lineInfo, i, &lastLine, + while (display_line (fp, &last_pos, &lineInfo, i, &lastLine, &maxLine, MUTT_SEARCH | (flags & MUTT_PAGER_NSKIP) | (flags & MUTT_PAGER_NOWRAP), &QuoteList, &q_level, &force_redraw, &SearchRE, pager_window) == 0) @@ -2407,7 +2407,7 @@ search_next: /* searching forward */ for (i = topline; i < lastLine; i++) { - if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && + if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && !lineInfo[i].continuation && lineInfo[i].search_cnt > 0) break; } @@ -2419,7 +2419,7 @@ search_next: /* searching backward */ for (i = topline; i >= 0; i--) { - if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && + if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && !lineInfo[i].continuation && lineInfo[i].search_cnt > 0) break; } @@ -2524,7 +2524,7 @@ search_next: if (dretval < 0) { mutt_error (_("No more unquoted text after quoted text.")); - break; + break; } topline = new_topline; } @@ -2535,7 +2535,7 @@ search_next: { i = curline; /* make sure the types are defined to the end of file */ - while (display_line (fp, &last_pos, &lineInfo, i, &lastLine, + while (display_line (fp, &last_pos, &lineInfo, i, &lastLine, &maxLine, has_types | (flags & MUTT_PAGER_NOWRAP), &QuoteList, &q_level, &force_redraw, &SearchRE, pager_window) == 0) @@ -2592,13 +2592,13 @@ search_next: CHECK_MODE (IsHeader (extra)); if (!(WithCrypto & APPLICATION_PGP)) break; - if (!(extra->hdr->security & PGP_TRADITIONAL_CHECKED)) + if (!(extra->hdr->security & PGP_TRADITIONAL_CHECKED)) { ch = -1; rc = OP_CHECK_TRADITIONAL; } break; - + case OP_CREATE_ALIAS: CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra)); if (IsMsgAttach (extra)) @@ -2705,8 +2705,8 @@ search_next: mutt_menuDestroy (&index); index = NULL; } - - if (option (OPTWRAP) != old_smart_wrap || + + if (option (OPTWRAP) != old_smart_wrap || option (OPTMARKERS) != old_markers) { if (flags & MUTT_PAGER_RETWINCH) @@ -2749,7 +2749,7 @@ search_next: /* try to keep the old position */ topline = 0; lastLine = 0; - while (j > 0 && display_line (fp, &last_pos, &lineInfo, topline, + while (j > 0 && display_line (fp, &last_pos, &lineInfo, topline, &lastLine, &maxLine, (has_types ? MUTT_TYPES : 0) | (flags & MUTT_PAGER_NOWRAP), &QuoteList, &q_level, &force_redraw, @@ -2804,7 +2804,7 @@ search_next: case OP_MAIL: CHECK_MODE(IsHeader (extra) && !IsAttach (extra)); - CHECK_ATTACH; + CHECK_ATTACH; ci_send_message (0, NULL, NULL, extra->ctx, NULL); redraw = REDRAW_FULL; break; @@ -2865,8 +2865,8 @@ search_next: case OP_REPLY: CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra)); - CHECK_ATTACH; - if (IsMsgAttach (extra)) + CHECK_ATTACH; + if (IsMsgAttach (extra)) mutt_attach_reply (extra->fp, extra->hdr, extra->idx, extra->idxlen, extra->bdy, SENDREPLY); @@ -2895,7 +2895,7 @@ search_next: case OP_LIST_REPLY: CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra)); - CHECK_ATTACH; + CHECK_ATTACH; if (IsMsgAttach (extra)) mutt_attach_reply (extra->fp, extra->hdr, extra->idx, extra->idxlen, extra->bdy, SENDREPLY|SENDLISTREPLY); @@ -3154,9 +3154,9 @@ search_next: break; } } - + cleanup_quote (&QuoteList); - + for (i = 0; i < maxLine ; i++) { FREE (&(lineInfo[i].syntax)); diff --git a/pager.h b/pager.h index ae8866f67..47ddeef7a 100644 --- a/pager.h +++ b/pager.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #include "attach.h" diff --git a/parse.c b/parse.c index 5b0414307..53341aa66 100644 --- a/parse.c +++ b/parse.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2012-2013 Michael R. Elkins - * + * * 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" @@ -49,7 +49,7 @@ char *mutt_read_rfc822_line (FILE *f, char *line, size_t *linelen) FOREVER { if (fgets (buf, *linelen - offset, f) == NULL || /* end of file or */ - (ISSPACE (*line) && !offset)) /* end of headers */ + (ISSPACE (*line) && !offset)) /* end of headers */ { *line = 0; return (line); @@ -145,7 +145,7 @@ static PARAMETER *parse_parameters (const char *s) size_t i; mutt_debug (2, "parse_parameters: `%s'\n", s); - + while (*s) { if ((p = strpbrk (s, "=;")) == NULL) @@ -253,7 +253,7 @@ static PARAMETER *parse_parameters (const char *s) s = skip_email_wsp(s + 1); } while (*s == ';'); /* skip empty parameters */ - } + } bail: @@ -267,7 +267,7 @@ int mutt_check_mime_type (const char *s) return TYPETEXT; else if (ascii_strcasecmp ("multipart", s) == 0) return TYPEMULTIPART; -#ifdef SUN_ATTACHMENT +#ifdef SUN_ATTACHMENT else if (ascii_strcasecmp ("x-sun-attachment", s) == 0) return TYPEMULTIPART; #endif @@ -312,15 +312,15 @@ void mutt_parse_content_type (char *s, BODY *ct) * let that take precedence, and don't set it here */ if ((pc = mutt_get_parameter( "name", ct->parameter)) && !ct->filename) ct->filename = safe_strdup(pc); - + #ifdef SUN_ATTACHMENT /* this is deep and utter perversion */ if ((pc = mutt_get_parameter ("conversions", ct->parameter))) ct->encoding = mutt_check_encoding (pc); #endif - + } - + /* Now get the subtype */ if ((subtype = strchr(s, '/'))) { @@ -414,13 +414,13 @@ BODY *mutt_read_mime_header (FILE *fp, int digest) char *c; char *line = safe_malloc (LONG_STRING); size_t linelen = LONG_STRING; - + p->hdr_offset = ftello (fp); p->encoding = ENC7BIT; /* default from RFC1521 */ p->type = digest ? TYPEMESSAGE : TYPETEXT; p->disposition = DISPINLINE; - + while (*(line = mutt_read_rfc822_line (fp, line, &linelen)) != 0) { /* Find the value of the current header */ @@ -454,7 +454,7 @@ BODY *mutt_read_mime_header (FILE *fp, int digest) mutt_str_replace (&p->description, c); rfc2047_decode (&p->description); } - } + } #ifdef SUN_ATTACHMENT else if (!ascii_strncasecmp ("x-sun-", line, 6)) { @@ -498,7 +498,7 @@ void mutt_parse_part (FILE *fp, BODY *b) bound = mutt_get_parameter ("boundary", b->parameter); fseeko (fp, b->offset, SEEK_SET); - b->parts = mutt_parse_multipart (fp, bound, + b->parts = mutt_parse_multipart (fp, bound, b->offset + b->length, ascii_strcasecmp ("digest", b->subtype) == 0); break; @@ -633,12 +633,12 @@ BODY *mutt_parse_multipart (FILE *fp, const char *boundary, LOFF_T end_off, int break; } #endif - + /* * Consistency checking - catch * bad attachment end boundaries */ - + if(new->offset > end_off) { mutt_free_body(&new); @@ -662,7 +662,7 @@ BODY *mutt_parse_multipart (FILE *fp, const char *boundary, LOFF_T end_off, int /* parse recursive MIME parts */ for(last = head; last; last = last->next) mutt_parse_part(fp, last); - + return (head); } @@ -766,11 +766,11 @@ time_t mutt_parse_date (const char *s, HEADER *h) char scratch[SHORT_STRING]; /* Don't modify our argument. Fixed-size buffer is ok here since - * the date format imposes a natural limit. + * the date format imposes a natural limit. */ strfcpy (scratch, s, sizeof (scratch)); - + /* kill the day of the week, if it exists. */ if ((t = strchr (scratch, ','))) t++; @@ -912,7 +912,7 @@ char *mutt_extract_message_id (const char *s, const char **saveptr) { if (*p == '<') { - s = p; + s = p; o = onull = NULL; continue; } @@ -934,7 +934,7 @@ char *mutt_extract_message_id (const char *s, const char **saveptr) } /* some idiotic clients break their message-ids between lines */ - if (s == p) + if (s == p) /* step past another whitespace */ s = p + 1; else if (o) @@ -983,10 +983,10 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short { int matched = 0; LIST *last = NULL; - + if (lastp) last = *lastp; - + switch (tolower (line[0])) { case 'a': @@ -1001,7 +1001,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short matched = 1; } break; - + case 'b': if (ascii_strcasecmp (line+1, "cc") == 0) { @@ -1009,7 +1009,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short matched = 1; } break; - + case 'c': if (ascii_strcasecmp (line+1, "c") == 0) { @@ -1056,7 +1056,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short } } break; - + case 'd': if (!ascii_strcasecmp ("ate", line + 1)) { @@ -1066,13 +1066,13 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short matched = 1; } break; - + case 'e': if (!ascii_strcasecmp ("xpires", line + 1) && hdr && mutt_parse_date (p, NULL) < time (NULL)) hdr->expired = 1; break; - + case 'f': if (!ascii_strcasecmp ("rom", line + 1)) { @@ -1091,7 +1091,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short } #endif break; - + case 'i': if (!ascii_strcasecmp (line+1, "n-reply-to")) { @@ -1106,9 +1106,9 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short { if (hdr) { - /* + /* * HACK - mutt has, for a very short time, produced negative - * Lines header values. Ignore them. + * Lines header values. Ignore them. */ if (mutt_atoi (p, &hdr->lines) < 0 || hdr->lines < 0) hdr->lines = 0; @@ -1127,7 +1127,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short ++beg; if (!(end = strchr (beg, '>'))) break; - + /* Take the first mailto URL */ if (url_check_scheme (beg) == U_MAILTO) { @@ -1140,7 +1140,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short matched = 1; } break; - + case 'm': if (!ascii_strcasecmp (line + 1, "ime-version")) { @@ -1171,7 +1171,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short } } break; - + #ifdef USE_NNTP case 'n': if (!ascii_strcasecmp (line + 1, "ewsgroups")) @@ -1215,13 +1215,13 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short if (hdr && !hdr->received) { char *d = strrchr (p, ';'); - + if (d) hdr->received = mutt_parse_date (d + 1, NULL); } } break; - + case 's': if (!ascii_strcasecmp (line + 1, "ubject")) { @@ -1264,7 +1264,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short e->supersedes = safe_strdup (p); } break; - + case 't': if (ascii_strcasecmp (line+1, "o") == 0) { @@ -1272,7 +1272,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short matched = 1; } break; - + case 'x': if (ascii_strcasecmp (line+1, "-status") == 0) { @@ -1334,7 +1334,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short { /* restore the original line */ line[strlen (line)] = ':'; - + if (weed && option (OPTWEED) && mutt_matches_ignore (line)) goto done; @@ -1351,12 +1351,12 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short } done: - + *lastp = last; return matched; } - + /* mutt_read_rfc822_header() -- parses a RFC822 header * * Args: @@ -1364,14 +1364,14 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short * f stream to read from * * hdr header structure of current message (optional). - * + * * user_hdrs If set, store user headers. Used for recall-message and * postpone modes. - * + * * weed If this parameter is set and the user has activated the * $weed option, honor the header weed list for user headers. * Used for recall-message. - * + * * Returns: newly allocated envelope structure. You should free it by * mutt_free_envelope() when envelope stay unneeded. */ @@ -1544,7 +1544,7 @@ ADDRESS *mutt_parse_adrlist (ADDRESS *p, const char *s) } else p = rfc822_parse_adrlist (p, s); - + return p; } @@ -1686,21 +1686,21 @@ int mutt_count_body_parts (CONTEXT *ctx, HEADER *hdr) if (hdr->attach_valid) return hdr->attach_total; - + if (hdr->content->parts) keep_parts = 1; else mutt_parse_mime_message (ctx, hdr); - + if (AttachAllow || AttachExclude || InlineAllow || InlineExclude) hdr->attach_total = count_body_parts(hdr->content, MUTT_PARTS_TOPLEVEL); else hdr->attach_total = 0; hdr->attach_valid = 1; - + if (!keep_parts) mutt_free_body (&hdr->content->parts); - + return hdr->attach_total; } diff --git a/pattern.c b/pattern.c index 6de0b55a4..687bf49e9 100644 --- a/pattern.c +++ b/pattern.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2006-2007,2010 Michael R. Elkins , and others - * + * * 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" @@ -137,9 +137,9 @@ int mutt_which_case (const char *s) wchar_t w; mbstate_t mb; size_t l; - + memset (&mb, 0, sizeof (mb)); - + for (; (l = mbrtowc (&w, s, MB_CUR_MAX, &mb)) != 0; s += l) { if (l == (size_t) -2) @@ -286,7 +286,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) } FREE (&buf); - + mx_close_message (ctx, &msg); if (option (OPTTHOROUGHSRC)) @@ -602,7 +602,7 @@ eat_range_by_regexp (pattern_t *pat, BUFFER *s, int kind, BUFFER *err) } pat->min = pat->max = CTX_MSGNO(Context); } - + /* Since we don't enforce order, we must swap bounds if they're backward */ order_range(pat); @@ -660,9 +660,9 @@ int eat_range (pattern_t *pat, BUFFER *s, BUFFER *err) char *tmp; int do_exclusive = 0; int skip_quote = 0; - + /* - * If simple_search is set to "~m %s", the range will have double quotes + * If simple_search is set to "~m %s", the range will have double quotes * around it... */ if (*s->dptr == '"') @@ -711,7 +711,7 @@ int eat_range (pattern_t *pat, BUFFER *s, BUFFER *err) s->dptr++; tmp = s->dptr; } - + if (isdigit ((unsigned char) *tmp)) { /* range maximum */ @@ -820,19 +820,19 @@ static void adjust_date_range (struct tm *min, struct tm *max) && min->tm_mday > max->tm_mday)) { int tmp; - + tmp = min->tm_year; min->tm_year = max->tm_year; max->tm_year = tmp; - + tmp = min->tm_mon; min->tm_mon = max->tm_mon; max->tm_mon = tmp; - + tmp = min->tm_mday; min->tm_mday = max->tm_mday; max->tm_mday = tmp; - + min->tm_hour = min->tm_min = min->tm_sec = 0; max->tm_hour = 23; max->tm_min = max->tm_sec = 59; @@ -842,7 +842,7 @@ static void adjust_date_range (struct tm *min, struct tm *max) static const char * parse_date_range (const char* pc, struct tm *min, struct tm *max, int haveMin, struct tm *baseMin, BUFFER *err) { - int flag = MUTT_PDR_NONE; + int flag = MUTT_PDR_NONE; while (*pc && ((flag & MUTT_PDR_DONE) == 0)) { const char *pt; @@ -1032,7 +1032,7 @@ static int eat_date (pattern_t *pat, BUFFER *s, BUFFER *err) memcpy (&min, tm, sizeof (min)); min.tm_hour = min.tm_sec = min.tm_min = 0; } - + /* preset max date for relative offsets, if nothing follows we search for messages on a specific day */ max.tm_year = min.tm_year; @@ -1672,7 +1672,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, static void quote_simple(char *tmp, size_t len, const char *p) { int i = 0; - + tmp[i++] = '"'; while (*p && i < len - 3) { @@ -1683,7 +1683,7 @@ static void quote_simple(char *tmp, size_t len, const char *p) tmp[i++] = '"'; tmp[i] = 0; } - + /* convert a simple search into a real request */ void mutt_check_simple (char *s, size_t len, const char *simple) { @@ -1820,7 +1820,7 @@ int mutt_pattern_func (int op, char *prompt) return (-1); mutt_message (_("Compiling search pattern...")); - + simple = safe_strdup (buf); mutt_check_simple (buf, sizeof (buf), NONULL (SimpleSearch)); @@ -1884,12 +1884,12 @@ int mutt_pattern_func (int op, char *prompt) mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_PURGE, 0); case MUTT_DELETE: - mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_DELETE, + mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_DELETE, (op == MUTT_DELETE)); break; case MUTT_TAG: case MUTT_UNTAG: - mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_TAG, + mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_TAG, (op == MUTT_TAG)); break; } @@ -1950,7 +1950,7 @@ int mutt_search_command (int cur, int op) else set_option (OPTSEARCHREVERSE); - /* compare the *expanded* version of the search pattern in case + /* compare the *expanded* version of the search pattern in case $simple_search has changed while we were searching */ strfcpy (temp, buf, sizeof (temp)); mutt_check_simple (temp, sizeof (temp), NONULL (SimpleSearch)); @@ -2002,7 +2002,7 @@ int mutt_search_command (int cur, int op) i = 0; if (option (OPTWRAPSEARCH)) msg = _("Search wrapped to top."); - else + else { mutt_message (_("Search hit bottom without finding match")); return (-1); @@ -2013,7 +2013,7 @@ int mutt_search_command (int cur, int op) i = Context->vcount - 1; if (option (OPTWRAPSEARCH)) msg = _("Search wrapped to bottom."); - else + else { mutt_message (_("Search hit top without finding match")); return (-1); diff --git a/pgp.c b/pgp.c index 915ab3084..d672ec2ed 100644 --- a/pgp.c +++ b/pgp.c @@ -7,16 +7,16 @@ * 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 all of the PGP routines necessary to sign, encrypt, @@ -86,7 +86,7 @@ int pgp_valid_passphrase (void) if (now < PgpExptime) /* Use cached copy. */ return 1; - + pgp_void_passphrase (); if (mutt_get_password (_("Enter PGP passphrase:"), PgpPass, sizeof (PgpPass)) == 0) @@ -195,7 +195,7 @@ static int pgp_copy_checksig (FILE *fpin, FILE *fpout) char *line = NULL; int lineno = 0; size_t linelen; - + while ((line = mutt_read_line (line, &linelen, fpin, &lineno, 0)) != NULL) { if (regexec (PgpGoodSign.rx, line, 0, NULL, 0) == 0) @@ -206,7 +206,7 @@ static int pgp_copy_checksig (FILE *fpin, FILE *fpout) else mutt_debug (2, "pgp_copy_checksig: \"%s\" doesn't match regexp.\n", line); - + if (strncmp (line, "[GNUPG:] ", 9) == 0) continue; fputs (line, fpout); @@ -263,26 +263,26 @@ static int pgp_check_decryption_okay (FILE *fpin) } -/* +/* * Copy a clearsigned message, and strip the signature and PGP's * dash-escaping. - * + * * XXX - charset handling: We assume that it is safe to do * character set decoding first, dash decoding second here, while * we do it the other way around in the main handler. - * + * * (Note that we aren't worse than Outlook &c in this, and also * note that we can successfully handle anything produced by any - * existing versions of mutt.) + * existing versions of mutt.) */ static void pgp_copy_clearsigned (FILE *fpin, STATE *s, char *charset) { char buf[HUGE_STRING]; short complete, armor_header; - + FGETCONV *fc; - + rewind (fpin); /* fromcode comes from the MIME Content-Type charset label. It might @@ -290,7 +290,7 @@ static void pgp_copy_clearsigned (FILE *fpin, STATE *s, char *charset) * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM. */ fc = fgetconv_open (fpin, charset, Charset, MUTT_ICONV_HOOK_FROM); - + for (complete = 1, armor_header = 1; fgetconvs (buf, sizeof (buf), fc) != NULL; complete = strchr (buf, '\n') != NULL) @@ -304,24 +304,24 @@ static void pgp_copy_clearsigned (FILE *fpin, STATE *s, char *charset) if (mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0) break; - + if (armor_header) { char *p = mutt_skip_whitespace (buf); - if (*p == '\0') + if (*p == '\0') armor_header = 0; continue; } - - if (s->prefix) + + if (s->prefix) state_puts (s->prefix, s); - + if (buf[0] == '-' && buf[1] == ' ') state_puts (buf + 2, s); else state_puts (buf, s); } - + fgetconv_close (&fc); } @@ -354,16 +354,16 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) fseeko (s->fpin, m->offset, 0); last_pos = m->offset; - + for (bytes = m->length; bytes > 0;) { if (fgets (buf, sizeof (buf), s->fpin) == NULL) break; - + offset = ftello (s->fpin); bytes -= (offset - last_pos); /* don't rely on mutt_strlen(buf) */ last_pos = offset; - + if (mutt_strncmp ("-----BEGIN PGP ", buf, 15) == 0) { clearsign = 0; @@ -379,7 +379,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) { needpass = 0; pgp_keyblock = 1; - } + } else { /* XXX - we may wish to recode here */ @@ -399,18 +399,18 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) FREE(&gpgcharset); return -1; } - + fputs (buf, tmpfp); while (bytes > 0 && fgets (buf, sizeof (buf) - 1, s->fpin) != NULL) { offset = ftello (s->fpin); bytes -= (offset - last_pos); /* don't rely on mutt_strlen(buf) */ last_pos = offset; - + fputs (buf, tmpfp); if ((needpass && mutt_strcmp ("-----END PGP MESSAGE-----\n", buf) == 0) || - (!needpass + (!needpass && (mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf) == 0 || mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\n",buf) == 0))) break; @@ -441,7 +441,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) FREE(&gpgcharset); return -1; } - + if ((thepid = pgp_invoke_decode (&pgpin, NULL, &pgperr, -1, fileno (pgpout), -1, tmpfname, needpass)) == -1) @@ -461,7 +461,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) *PgpPass = 0; fprintf (pgpin, "%s\n", PgpPass); } - + safe_fclose (&pgpin); if (s->flags & MUTT_DISPLAY) @@ -469,10 +469,10 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) crypt_current_time (s, "PGP"); rc = pgp_copy_checksig (pgperr, s->fpout); } - + safe_fclose (&pgperr); rv = mutt_wait_filter (thepid); - + if (s->flags & MUTT_DISPLAY) { if (rc == 0) have_any_sigs = 1; @@ -483,13 +483,13 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) * gpg_good_sign="" && pgp_decode_command returned 0 */ if (rc == -1 || rv) maybe_goodsig = 0; - + state_attach_puts (_("[-- End of PGP output --]\n\n"), s); } if (pgp_use_gpg_agent()) mutt_need_hard_redraw (); } - + /* treat empty result as sign of failure */ /* TODO: maybe on failure mutt should include the original undecoded text. */ if (pgpout) @@ -503,7 +503,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) could_not_decrypt = 1; pgp_void_passphrase (); } - + if (could_not_decrypt && !(s->flags & MUTT_DISPLAY)) { mutt_error (_("Could not decrypt PGP message")); @@ -512,7 +512,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) goto out; } } - + /* * Now, copy cleartext to the screen. */ @@ -530,7 +530,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) if (clearsign) { rewind (tmpfp); - if (tmpfp) + if (tmpfp) pgp_copy_clearsigned (tmpfp, s, body_charset); } else if (pgpout) @@ -612,7 +612,7 @@ out: state_attach_puts (_("[-- Error: could not find beginning of PGP message! --]\n\n"), s); return -1; } - + return rc; } @@ -621,11 +621,11 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) char tempfile[_POSIX_PATH_MAX]; char buf[HUGE_STRING]; FILE *tfp; - + short sgn = 0; short enc = 0; short key = 0; - + if (b->type != TYPETEXT) return 0; @@ -638,13 +638,13 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) unlink (tempfile); return 0; } - + if ((tfp = fopen (tempfile, "r")) == NULL) { unlink (tempfile); return 0; } - + while (fgets (buf, sizeof (buf), tfp)) { if (mutt_strncmp ("-----BEGIN PGP ", buf, 15) == 0) @@ -664,7 +664,7 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) return 0; /* fix the content type */ - + mutt_set_parameter ("format", "fixed", &b->parameter); if (enc) mutt_set_parameter ("x-action", "pgp-encrypted", &b->parameter); @@ -672,7 +672,7 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) mutt_set_parameter ("x-action", "pgp-signed", &b->parameter); else if (key) mutt_set_parameter ("x-action", "pgp-keys", &b->parameter); - + return 1; } @@ -696,7 +696,7 @@ int pgp_check_traditional (FILE *fp, BODY *b, int tagged_only) return rv; } - + @@ -707,19 +707,19 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) pid_t thepid; int badsig = -1; int rv; - + snprintf (sigfile, sizeof (sigfile), "%s.asc", tempfile); - + if(!(fp = safe_fopen (sigfile, "w"))) { mutt_perror(sigfile); return -1; } - + fseeko (s->fpin, sigbdy->offset, 0); mutt_copy_bytes (s->fpin, fp, sigbdy->length); safe_fclose (&fp); - + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if(!(pgperr = safe_fopen(pgperrfile, "w+"))) { @@ -727,27 +727,27 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) unlink(sigfile); return -1; } - + crypt_current_time (s, "PGP"); - - if((thepid = pgp_invoke_verify (NULL, &pgpout, NULL, + + if((thepid = pgp_invoke_verify (NULL, &pgpout, NULL, -1, -1, fileno(pgperr), tempfile, sigfile)) != -1) { if (pgp_copy_checksig (pgpout, s->fpout) >= 0) badsig = 0; - - + + safe_fclose (&pgpout); fflush (pgperr); rewind (pgperr); - + if (pgp_copy_checksig (pgperr, s->fpout) >= 0) badsig = 0; if ((rv = mutt_wait_filter (thepid))) badsig = -1; - + mutt_debug (1, "pgp_verify_one: mutt_wait_filter returned %d.\n", rv); } @@ -759,7 +759,7 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) mutt_unlink (pgperrfile); mutt_debug (1, "pgp_verify_one: returning %d.\n", badsig); - + return badsig; } @@ -787,7 +787,7 @@ void pgp_extract_keys_from_messages (HEADER *h) } set_option (OPTDONTHANDLEPGPKEYS); - + if (!h) { for (i = 0; i < Context->vcount; i++) @@ -801,11 +801,11 @@ void pgp_extract_keys_from_messages (HEADER *h) safe_fclose (&fpout); goto bailout; } - mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]], + mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]], MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0); } } - } + } else { mutt_parse_mime_message (Context, h); @@ -816,17 +816,17 @@ void pgp_extract_keys_from_messages (HEADER *h) } mutt_copy_message (fpout, Context, h, MUTT_CM_DECODE|MUTT_CM_CHARCONV, 0); } - + safe_fclose (&fpout); mutt_endwin (NULL); pgp_invoke_import (tempfname); mutt_any_key_to_continue (NULL); bailout: - + mutt_unlink (tempfname); unset_option (OPTDONTHANDLEPGPKEYS); - + } static void pgp_extract_keys_from_attachment (FILE *fp, BODY *top) @@ -843,10 +843,10 @@ static void pgp_extract_keys_from_attachment (FILE *fp, BODY *top) } memset (&s, 0, sizeof (STATE)); - + s.fpin = fp; s.fpout = tempfp; - + mutt_body_handler (top, &s); safe_fclose (&tempfp); @@ -867,16 +867,16 @@ void pgp_extract_keys_from_attachment_list (FILE *fp, int tag, BODY *top) mutt_endwin (NULL); set_option(OPTDONTHANDLEPGPKEYS); - + for(; top; top = top->next) { if(!tag || top->tagged) pgp_extract_keys_from_attachment (fp, top); - + if(!tag) break; } - + unset_option(OPTDONTHANDLEPGPKEYS); } @@ -891,7 +891,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p) char pgptmpfile[_POSIX_PATH_MAX]; pid_t thepid; int rv; - + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if ((pgperr = safe_fopen (pgperrfile, "w+")) == NULL) { @@ -933,7 +933,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p) fputs (PgpPass, pgpin); fputc ('\n', pgpin); safe_fclose (&pgpin); - + /* Read the output from PGP, and make sure to change CRLF to LF, otherwise * read_mime_header has a hard time parsing the message. */ @@ -983,7 +983,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p) } rewind (fpout); - + if ((tattach = mutt_read_mime_header (fpout, 0)) != NULL) { /* @@ -1108,16 +1108,16 @@ int pgp_encrypted_handler (BODY *a, STATE *s) rc = mutt_body_handler (tattach, s); s->fpin = fpin; - /* + /* * if a multipart/signed is the _only_ sub-part of a * multipart/encrypted, cache signature verification * status. * */ - + if (mutt_is_multipart_signed (tattach) && !tattach->next) a->goodsig |= tattach->goodsig; - + if (s->flags & MUTT_DISPLAY) { state_puts ("\n", s); @@ -1157,7 +1157,7 @@ BODY *pgp_sign_message (BODY *a) int err = 0; int empty = 1; pid_t thepid; - + convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ mutt_mktemp (sigfile, sizeof (sigfile)); @@ -1174,12 +1174,12 @@ BODY *pgp_sign_message (BODY *a) unlink(sigfile); return NULL; } - + mutt_write_mime_header (a, sfp); fputc ('\n', sfp); mutt_write_mime_body (a, sfp); safe_fclose (&sfp); - + if ((thepid = pgp_invoke_sign (&pgpin, &pgpout, &pgperr, -1, -1, -1, signedfile)) == -1) { @@ -1189,12 +1189,12 @@ BODY *pgp_sign_message (BODY *a) unlink(signedfile); return NULL; } - + if (!pgp_use_gpg_agent()) fputs(PgpPass, pgpin); fputc('\n', pgpin); safe_fclose (&pgpin); - + /* * Read back the PGP signature. Also, change MESSAGE=>SIGNATURE as * recommended for future releases of PGP. @@ -1224,7 +1224,7 @@ BODY *pgp_sign_message (BODY *a) safe_fclose (&pgperr); safe_fclose (&pgpout); unlink (signedfile); - + if (fclose (fp) != 0) { mutt_perror ("fclose"); @@ -1404,7 +1404,7 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) int err = 0; int empty = 0; pid_t thepid; - + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w+")) == NULL) { @@ -1431,16 +1431,16 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) safe_fclose (&pgperr); return NULL; } - + if (sign) convert_to_7bit (a); - + mutt_write_mime_header (a, fptmp); fputc ('\n', fptmp); mutt_write_mime_body (a, fptmp); safe_fclose (&fptmp); - - if ((thepid = pgp_invoke_encrypt (&pgpin, NULL, NULL, -1, + + if ((thepid = pgp_invoke_encrypt (&pgpin, NULL, NULL, -1, fileno (fpout), fileno (pgperr), pgpinfile, keylist, sign)) == -1) { @@ -1457,12 +1457,12 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) fputc ('\n', pgpin); } safe_fclose (&pgpin); - + if(mutt_wait_filter (thepid) && option(OPTPGPCHECKEXIT)) empty=1; unlink(pgpinfile); - + fflush (fpout); rewind (fpout); if(!empty) @@ -1500,7 +1500,7 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) mutt_generate_boundary(&t->parameter); mutt_set_parameter("protocol", "application/pgp-encrypted", &t->parameter); - + t->parts = mutt_new_body (); t->parts->type = TYPEAPPLICATION; t->parts->subtype = safe_strdup ("pgp-encrypted"); @@ -1526,11 +1526,11 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) char pgpoutfile[_POSIX_PATH_MAX]; char pgperrfile[_POSIX_PATH_MAX]; char pgpinfile[_POSIX_PATH_MAX]; - + char body_charset[STRING]; char *from_charset; const char *send_charset; - + FILE *pgpout = NULL, *pgperr = NULL, *pgpin = NULL; FILE *fp; @@ -1545,13 +1545,13 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) return NULL; if (ascii_strcasecmp (a->subtype, "plain")) return NULL; - + if ((fp = fopen (a->filename, "r")) == NULL) { mutt_perror (a->filename); return NULL; } - + mutt_mktemp (pgpinfile, sizeof (pgpinfile)); if ((pgpin = safe_fopen (pgpinfile, "w")) == NULL) { @@ -1565,18 +1565,18 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) * we have to convert from that to utf-8. If noconv is not set, * we have to convert from $charset to utf-8. */ - + mutt_get_body_charset (body_charset, sizeof (body_charset), a); if (a->noconv) from_charset = body_charset; - else + else from_charset = Charset; - + if (!mutt_is_us_ascii (body_charset)) { int c; FGETCONV *fc; - + if (flags & ENCRYPT) send_charset = "us-ascii"; else @@ -1586,7 +1586,7 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) fc = fgetconv_open (fp, from_charset, "utf-8", 0); while ((c = fgetconv (fc)) != EOF) fputc (c, pgpin); - + fgetconv_close (&fc); } else @@ -1604,17 +1604,17 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) { mutt_perror (pgpout ? pgperrfile : pgpoutfile); unlink (pgpinfile); - if (pgpout) + if (pgpout) { safe_fclose (&pgpout); unlink (pgpoutfile); } return NULL; } - + unlink (pgperrfile); - if ((thepid = pgp_invoke_traditional (&pgpin, NULL, NULL, + if ((thepid = pgp_invoke_traditional (&pgpin, NULL, NULL, -1, fileno (pgpout), fileno (pgperr), pgpinfile, keylist, flags)) == -1) { @@ -1642,24 +1642,24 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) rewind (pgpout); rewind (pgperr); - + if(!empty) empty = (fgetc (pgpout) == EOF); safe_fclose (&pgpout); - + err = 0; - + while (fgets (buff, sizeof (buff), pgperr)) { err = 1; fputs (buff, stdout); } - + safe_fclose (&pgperr); - + if (err) mutt_any_key_to_continue (NULL); - + if (empty) { if (flags & SIGN) @@ -1667,22 +1667,22 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) unlink (pgpoutfile); return NULL; } - + b = mutt_new_body (); - + b->encoding = ENC7BIT; b->type = TYPETEXT; b->subtype = safe_strdup ("plain"); - + mutt_set_parameter ("x-action", flags & ENCRYPT ? "pgp-encrypted" : "pgp-signed", &b->parameter); mutt_set_parameter ("charset", send_charset, &b->parameter); - + b->filename = safe_strdup (pgpoutfile); - + #if 0 - /* The following is intended to give a clue to some completely brain-dead + /* The following is intended to give a clue to some completely brain-dead * "mail environments" which are typically used by large corporations. */ @@ -1696,10 +1696,10 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) b->noconv = 1; b->use_disp = 0; - + if (!(flags & ENCRYPT)) b->encoding = a->encoding; - + return b; } @@ -1715,7 +1715,7 @@ int pgp_send_menu (HEADER *msg, int *redraw) return msg->security; /* If autoinline and no crypto options set, then set inline. */ - if (option (OPTPGPAUTOINLINE) && + if (option (OPTPGPAUTOINLINE) && !((msg->security & APPLICATION_PGP) && (msg->security & (SIGN|ENCRYPT)))) msg->security |= INLINE; @@ -1776,7 +1776,7 @@ int pgp_send_menu (HEADER *msg, int *redraw) if (msg->security & (ENCRYPT | SIGN)) { - snprintf (promptbuf, sizeof (promptbuf), + snprintf (promptbuf, sizeof (promptbuf), /* L10N: PGP options (inline) (opportunistic encryption is off) */ _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode? "), mime_inline); prompt = promptbuf; @@ -1804,7 +1804,7 @@ int pgp_send_menu (HEADER *msg, int *redraw) if (msg->security & (ENCRYPT | SIGN)) { - snprintf (promptbuf, sizeof (promptbuf), + snprintf (promptbuf, sizeof (promptbuf), /* L10N: PGP options (inline) */ _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear? "), mime_inline); prompt = promptbuf; diff --git a/pgp.h b/pgp.h index 6f9250688..da7ee7844 100644 --- a/pgp.h +++ b/pgp.h @@ -7,12 +7,12 @@ * 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. @@ -66,28 +66,28 @@ int pgp_valid_passphrase (void); /* The PGP invocation interface - not really beautiful. */ pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, short need_passphrase); pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *sig_fname); pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname); pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname); pid_t pgp_invoke_encrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *uids, int sign); pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids); pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids); pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, pgp_ring_t keyring, LIST *hints); pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, diff --git a/pgpinvoke.c b/pgpinvoke.c index 4ceed636f..7e8008c3e 100644 --- a/pgpinvoke.c +++ b/pgpinvoke.c @@ -1,23 +1,23 @@ /* * Copyright (C) 1997-2003 Thomas Roessler - * + * * 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 the new pgp invocation code. Note that this * is almost entirely format based. @@ -72,7 +72,7 @@ const char *_mutt_fmt_pgp_command (char *dest, char fmt[16]; struct pgp_command_context *cctx = (struct pgp_command_context *) data; int optional = (flags & MUTT_FORMAT_OPTIONAL); - + switch (op) { case 'r': @@ -86,7 +86,7 @@ const char *_mutt_fmt_pgp_command (char *dest, optional = 0; break; } - + case 'a': { if (!optional) @@ -98,7 +98,7 @@ const char *_mutt_fmt_pgp_command (char *dest, optional = 0; break; } - + case 's': { if (!optional) @@ -110,7 +110,7 @@ const char *_mutt_fmt_pgp_command (char *dest, optional = 0; break; } - + case 'f': { if (!optional) @@ -122,7 +122,7 @@ const char *_mutt_fmt_pgp_command (char *dest, optional = 0; break; } - + case 'p': { if (!optional) @@ -171,20 +171,20 @@ static pid_t pgp_invoke (FILE **pgpin, FILE **pgpout, FILE **pgperr, { struct pgp_command_context cctx; char cmd[HUGE_STRING]; - + memset (&cctx, 0, sizeof (cctx)); if (!format || !*format) return (pid_t) -1; - + cctx.need_passphrase = need_passphrase; cctx.fname = fname; cctx.sig_fname = sig_fname; cctx.signas = signas; cctx.ids = ids; - + mutt_pgp_command (cmd, sizeof (cmd), &cctx, format); - + return mutt_create_filter_fd (cmd, pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd); } @@ -192,23 +192,23 @@ static pid_t pgp_invoke (FILE **pgpin, FILE **pgpout, FILE **pgperr, /* * The exported interface. - * + * * This is historic and may be removed at some point. * */ pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, short need_passphrase) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - need_passphrase, fname, NULL, PgpSignAs, NULL, + need_passphrase, fname, NULL, PgpSignAs, NULL, PgpDecodeCommand); } pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *sig_fname) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -216,7 +216,7 @@ pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr, } pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -224,7 +224,7 @@ pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, } pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -238,7 +238,7 @@ pid_t pgp_invoke_encrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, { if (sign) return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 1, fname, NULL, PgpSignAs, uids, + 1, fname, NULL, PgpSignAs, uids, PgpEncryptSignCommand); else return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -252,7 +252,7 @@ pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr, { if (flags & ENCRYPT) return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - flags & SIGN ? 1 : 0, fname, NULL, PgpSignAs, uids, + flags & SIGN ? 1 : 0, fname, NULL, PgpSignAs, uids, flags & SIGN ? PgpEncryptSignCommand : PgpEncryptOnlyCommand); else return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -266,13 +266,13 @@ void pgp_invoke_import (const char *fname) char _fname[_POSIX_PATH_MAX + SHORT_STRING]; char cmd[HUGE_STRING]; struct pgp_command_context cctx; - + memset (&cctx, 0, sizeof (cctx)); - + mutt_quote_filename (_fname, sizeof (_fname), fname); cctx.fname = _fname; cctx.signas = PgpSignAs; - + mutt_pgp_command (cmd, sizeof (cmd), &cctx, PgpImportCommand); mutt_system (cmd); } @@ -285,25 +285,25 @@ void pgp_invoke_getkeys (ADDRESS *addr) int devnull; char *personal; - + struct pgp_command_context cctx; if (!PgpGetkeysCommand) return; - + memset (&cctx, 0, sizeof (cctx)); personal = addr->personal; addr->personal = NULL; - + *tmp = '\0'; mutt_addrlist_to_local (addr); rfc822_write_address_single (tmp, sizeof (tmp), addr, 0); mutt_quote_filename (buff, sizeof (buff), tmp); addr->personal = personal; - + cctx.ids = buff; - + mutt_pgp_command (cmd, sizeof (cmd), &cctx, PgpGetkeysCommand); devnull = open ("/dev/null", O_RDWR); @@ -318,7 +318,7 @@ void pgp_invoke_getkeys (ADDRESS *addr) } pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -327,7 +327,7 @@ pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr, } pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, @@ -336,15 +336,15 @@ pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, } pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, - int pgpinfd, int pgpoutfd, int pgperrfd, + int pgpinfd, int pgpoutfd, int pgperrfd, pgp_ring_t keyring, LIST *hints) { char uids[HUGE_STRING]; char tmpuids[HUGE_STRING]; char quoted[HUGE_STRING]; - + *uids = '\0'; - + for (; hints; hints = hints->next) { mutt_quote_filename (quoted, sizeof (quoted), (char *) hints->data); diff --git a/pgpkey.c b/pgpkey.c index cf56bd4ff..d8cee24de 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -1,19 +1,19 @@ /* * Copyright (C) 1996-1997,2007 Michael R. Elkins * Copyright (c) 1998-2003 Thomas Roessler - * + * * 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, @@ -88,7 +88,7 @@ static char pgp_flags (int flags) return 'd'; else if (flags & KEYFLAG_CRITICAL) return 'c'; - else + else return ' '; } @@ -102,7 +102,7 @@ static pgp_key_t pgp_principal_key (pgp_key_t key) /* * Format an entry on the PGP key selection menu. - * + * * %n number * %k key id %K key id of the principal key * %u user id @@ -293,7 +293,7 @@ static void pgp_entry (char *s, size_t l, MUTTMENU * menu, int num) entry.uid = KeyTable[num]; entry.num = num + 1; - mutt_FormatString (s, l, 0, MuttIndexWindow->cols, NONULL (PgpEntryFormat), pgp_entry_fmt, + mutt_FormatString (s, l, 0, MuttIndexWindow->cols, NONULL (PgpEntryFormat), pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); } @@ -326,7 +326,7 @@ static int _pgp_compare_keyid (const void *a, const void *b) pgp_uid_t **s = (pgp_uid_t **) a; pgp_uid_t **t = (pgp_uid_t **) b; - if ((r = mutt_strcasecmp (pgp_fpr_or_lkeyid ((*s)->parent), + if ((r = mutt_strcasecmp (pgp_fpr_or_lkeyid ((*s)->parent), pgp_fpr_or_lkeyid ((*t)->parent)))) return r > 0; else @@ -374,7 +374,7 @@ static int _pgp_compare_trust (const void *a, const void *b) return r < 0; if ((r = mutt_strcasecmp ((*s)->addr, (*t)->addr))) return r > 0; - return (mutt_strcasecmp (pgp_fpr_or_lkeyid ((*s)->parent), + return (mutt_strcasecmp (pgp_fpr_or_lkeyid ((*s)->parent), pgp_fpr_or_lkeyid ((*t)->parent))) > 0; } @@ -579,7 +579,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, safe_fclose (&fp); safe_fclose (&devnull); mutt_clear_error (); - snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"), + snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"), pgp_keyid (pgp_principal_key (KeyTable[menu->current]->parent))); mutt_do_pager (cmd, tempfile, 0, NULL); menu->redraw = REDRAW_FULL; @@ -609,7 +609,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, { char *s = ""; char buff[LONG_STRING]; - + if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE) s = N_("ID is expired/disabled/revoked."); else switch (KeyTable[menu->current]->trust & 0x03) @@ -754,7 +754,7 @@ BODY *pgp_make_key_attachment (char *tempf) mutt_message (_("Invoking PGP...")); - if ((thepid = + if ((thepid = pgp_invoke_export (NULL, NULL, NULL, -1, fileno (tempfp), fileno (devnull), tmp)) == -1) { @@ -924,15 +924,15 @@ pgp_key_t pgp_getkeybyaddr (ADDRESS * a, short abilities, pgp_ring_t keyring, { /* * There was precisely one strong match on a valid ID. - * + * * Proceed without asking the user. */ pgp_remove_key (&matches, the_strong_valid_key); k = the_strong_valid_key; } - else + else { - /* + /* * Else: Ask the user. */ if ((k = pgp_select_key (matches, a, NULL))) diff --git a/pgplib.c b/pgplib.c index 93f8b06e3..f29e19445 100644 --- a/pgplib.c +++ b/pgplib.c @@ -1,18 +1,18 @@ /* * Copyright (C) 1997-2002 Thomas Roessler - * + * * 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, @@ -109,7 +109,7 @@ short pgp_cansign (unsigned char type) } } -/* return values: +/* return values: * 1 = sign only * 2 = encrypt only @@ -124,16 +124,16 @@ short pgp_get_abilities (unsigned char type) void pgp_free_sig (pgp_sig_t **sigp) { pgp_sig_t *sp, *q; - + if (!sigp || !*sigp) return; - + for (sp = *sigp; sp; sp = q) { q = sp->next; FREE (&sp); } - + *sigp = NULL; } @@ -225,7 +225,7 @@ void pgp_free_key (pgp_key_t *kpp) if ((*kpp)->parent && (*kpp)->parent != *kpp) *kpp = (*kpp)->parent; - + /* Order is important here: * * - First free all children. diff --git a/pgplib.h b/pgplib.h index 023341696..a4b885449 100644 --- a/pgplib.h +++ b/pgplib.h @@ -6,12 +6,12 @@ * 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. diff --git a/pgpmicalg.c b/pgpmicalg.c index 759b745ec..eea42edf2 100644 --- a/pgpmicalg.c +++ b/pgpmicalg.c @@ -1,16 +1,16 @@ /* * Copyright (C) 2001 Thomas Roessler - * + * * 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, @@ -35,12 +35,12 @@ #include #include -static const struct +static const struct { short id; const char *name; -} -HashAlgorithms[] = +} +HashAlgorithms[] = { { 1, "pgp-md5" }, { 2, "pgp-sha1" }, @@ -58,7 +58,7 @@ HashAlgorithms[] = static const char *pgp_hash_to_micalg (short id) { int i; - + for (i = 0; HashAlgorithms[i].id >= 0; i++) if (HashAlgorithms[i].id == id) return HashAlgorithms[i].name; @@ -73,13 +73,13 @@ static void pgp_dearmor (FILE *in, FILE *out) char *r; STATE state; - + memset (&state, 0, sizeof (STATE)); state.fpin = in; state.fpout = out; - + /* find the beginning of ASCII armor */ - + while ((r = fgets (line, sizeof (line), in)) != NULL) { if (!strncmp (line, "-----BEGIN", 10)) @@ -92,7 +92,7 @@ static void pgp_dearmor (FILE *in, FILE *out) } /* skip the armor header */ - + while ((r = fgets (line, sizeof (line), in)) != NULL) { SKIPWS (r); @@ -103,12 +103,12 @@ static void pgp_dearmor (FILE *in, FILE *out) mutt_debug (1, "pgp_dearmor: Armor header doesn't end.\n"); return; } - + /* actual data starts here */ start = ftello (in); - + /* find the checksum */ - + while ((r = fgets (line, sizeof (line), in)) != NULL) { if (*line == '=' || !strncmp (line, "-----END", 8)) @@ -119,13 +119,13 @@ static void pgp_dearmor (FILE *in, FILE *out) mutt_debug (1, "pgp_dearmor: Can't find end of ASCII armor.\n"); return; } - + if ((end = ftello (in) - strlen (line)) < start) { mutt_debug (1, "pgp_dearmor: end < start???\n"); return; } - + if (fseeko (in, start, SEEK_SET) == -1) { mutt_debug (1, "pgp_dearmor: Can't seekto start.\n"); @@ -144,7 +144,7 @@ static short pgp_mic_from_packet (unsigned char *p, size_t len) p[0]&0x3f, PT_SIG); return -1; } - + if (len >= 18 && p[1] == 3) /* version 3 signature */ return (short) p[17]; @@ -162,14 +162,14 @@ static short pgp_find_hash (const char *fname) { FILE *in = NULL; FILE *out = NULL; - + char tempfile[_POSIX_PATH_MAX]; - + unsigned char *p; size_t l; - + short rv = -1; - + mutt_mktemp (tempfile, sizeof (tempfile)); if ((out = safe_fopen (tempfile, "w+")) == NULL) { @@ -177,13 +177,13 @@ static short pgp_find_hash (const char *fname) goto bye; } unlink (tempfile); - + if ((in = fopen (fname, "r")) == NULL) { mutt_perror (fname); goto bye; } - + pgp_dearmor (in, out); rewind (out); @@ -195,9 +195,9 @@ static short pgp_find_hash (const char *fname) { mutt_debug (1, "pgp_find_hash: No packet.\n"); } - + bye: - + safe_fclose (&in); safe_fclose (&out); pgp_release_packet (); diff --git a/pgppacket.c b/pgppacket.c index 50593871b..8c8afface 100644 --- a/pgppacket.c +++ b/pgppacket.c @@ -1,16 +1,16 @@ /* * Copyright (C) 2001-2002,2007 Thomas Roessler - * + * * 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, diff --git a/pgppacket.h b/pgppacket.h index 6af1ddc96..bf9c48f76 100644 --- a/pgppacket.h +++ b/pgppacket.h @@ -1,23 +1,23 @@ /* * Copyright (C) 2001 Thomas Roessler - * + * * 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. */ -/* +/* * Definitions for a rudimentary PGP packet parser which is shared * by mutt proper and the PGP public key ring lister. */ diff --git a/pgppubring.c b/pgppubring.c index 043732026..a72f26259 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -1,18 +1,18 @@ /* * Copyright (C) 1997-2003 Thomas Roessler - * + * * 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, @@ -21,14 +21,14 @@ /* * This is a "simple" PGP key ring dumper. - * + * * The output format is supposed to be compatible to the one GnuPG * emits and Mutt expects. - * + * * Note that the code of this program could be considerably less * complex, but most of it was taken from mutt's second generation * key ring parser. - * + * * You can actually use this to put together some fairly general * PGP key management applications. * @@ -78,10 +78,10 @@ static void pgpring_dump_keyblock (pgp_key_t p); int main (int argc, char * const argv[]) { int c; - + short version = 2; short secring = 0; - + const char *_kring = NULL; char *env_pgppath, *env_home; @@ -109,19 +109,19 @@ int main (int argc, char * const argv[]) _kring = optarg; break; } - + case '2': case '5': { version = c - '0'; break; } - + case 's': { secring = 1; break; } - + default: { fprintf (stderr, "usage: %s [-k | [-2 | -5] [ -s] [-S] [-f]] [hints]\n", @@ -144,15 +144,15 @@ int main (int argc, char * const argv[]) fprintf (stderr, "%s: Can't determine your PGPPATH.\n", argv[0]); exit (1); } - + if (secring) snprintf (kring, sizeof (kring), "%s/secring.%s", pgppath, version == 2 ? "pgp" : "skr"); else snprintf (kring, sizeof (kring), "%s/pubring.%s", pgppath, version == 2 ? "pgp" : "pkr"); } - + pgpring_find_candidates (kring, (const char**) argv + optind, argc - optind); - + return 0; } @@ -241,7 +241,7 @@ static pgp_key_t pgp_parse_pgp2_key (unsigned char *buff, size_t l) pgp_make_pgp2_fingerprint (&buff[j], digest); p->fingerprint = binary_fingerprint_to_string (digest, MD5_DIGEST_LENGTH); } - + expl = 0; for (i = 0; i < 2; i++) expl = (expl << 8) + buff[j++]; @@ -356,7 +356,7 @@ static pgp_key_t pgp_parse_pgp3_key (unsigned char *buff, size_t l) { p->fingerprint = binary_fingerprint_to_string (digest, SHA_DIGEST_LENGTH); } - + for (k = 0; k < 2; k++) { for (id = 0, i = SHA_DIGEST_LENGTH - 8 + k * 4; @@ -415,7 +415,7 @@ static int pgp_parse_pgp2_sig (unsigned char *buff, size_t l, for (i = 0; i < 4; i++) signerid2 = (signerid2 << 8) + buff[j++]; - + if (sigtype == 0x20 || sigtype == 0x28) p->flags |= KEYFLAG_REVOKED; @@ -425,7 +425,7 @@ static int pgp_parse_pgp2_sig (unsigned char *buff, size_t l, s->sid1 = signerid1; s->sid2 = signerid2; } - + return 0; } @@ -525,7 +525,7 @@ static int pgp_parse_pgp3_sig (unsigned char *buff, size_t l, signerid1 = (signerid1 << 8) + buff[j++]; for (i = 0; i < 4; i++) signerid2 = (signerid2 << 8) + buff[j++]; - + break; } case 10: /* CMR key */ @@ -565,7 +565,7 @@ static int pgp_parse_pgp3_sig (unsigned char *buff, size_t l, s->sid2 = signerid2; } - + return 0; } @@ -581,7 +581,7 @@ static int pgp_parse_sig (unsigned char *buff, size_t l, { case 2: case 3: - return pgp_parse_pgp2_sig (buff, l, p, sig); + return pgp_parse_pgp2_sig (buff, l, p, sig); case 4: return pgp_parse_pgp3_sig (buff, l, p, sig); default: @@ -613,20 +613,20 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) pgp_sig_t **lsig = NULL; FGETPOS(fp,pos); - + while (!err && (buff = pgp_read_packet (fp, &l)) != NULL) { last_pt = pt; pt = buff[0] & 0x3f; /* check if we have read the complete key block. */ - + if ((pt == PT_SECKEY || pt == PT_PUBKEY) && root) { FSETPOS(fp, pos); return root; } - + switch (pt) { case PT_SECKEY: @@ -643,7 +643,7 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) last = &p->next; addr = &p->address; lsig = &p->sigs; - + if (pt == PT_SUBKEY || pt == PT_SUBSECKEY) { p->flags |= KEYFLAG_SUBKEY; @@ -654,7 +654,7 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) while (*addr) addr = &(*addr)->next; } } - + if (pt == PT_SECKEY || pt == PT_SUBSECKEY) p->flags |= KEYFLAG_SECRET; @@ -668,7 +668,7 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) pgp_sig_t *signature = safe_calloc (sizeof (pgp_sig_t), 1); *lsig = signature; lsig = &signature->next; - + pgp_parse_sig (buff, l, p, signature); } break; @@ -709,7 +709,7 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) uid->trust = 0; addr = &uid->next; lsig = &uid->sigs; - + /* the following tags are generated by * pgp 2.6.3in. */ @@ -728,8 +728,8 @@ static pgp_key_t pgp_parse_keyblock (FILE * fp) if (err) pgp_free_key (&root); - - return root; + + return root; } static int pgpring_string_matches_hint (const char *s, const char *hints[], int nhints) @@ -748,7 +748,7 @@ static int pgpring_string_matches_hint (const char *s, const char *hints[], int return 0; } -/* +/* * Go through the key ring file and look for keys with * matching IDs. */ @@ -767,7 +767,7 @@ static void pgpring_find_candidates (char *ringfile, const char *hints[], int nh size_t l = 0; short err = 0; - + if ((rfp = fopen (ringfile, "r")) == NULL) { char *error_buf; @@ -787,10 +787,10 @@ static void pgpring_find_candidates (char *ringfile, const char *hints[], int nh while (!err && (buff = pgp_read_packet (rfp, &l)) != NULL) { pt = buff[0] & 0x3f; - + if (l < 1) continue; - + if ((pt == PT_SECKEY) || (pt == PT_PUBKEY)) { keypos = pos; @@ -814,7 +814,7 @@ static void pgpring_find_candidates (char *ringfile, const char *hints[], int nh if ((p = pgp_parse_keyblock (rfp)) == NULL) err = 1; - + pgpring_dump_keyblock (p); pgp_free_key (&p); } @@ -840,7 +840,7 @@ static void print_userid (const char *id) } } -static void print_fingerprint (pgp_key_t p) +static void print_fingerprint (pgp_key_t p) { if (!p->fingerprint) return; @@ -881,7 +881,7 @@ static void pgpring_dump_keyblock (pgp_key_t p) short first; struct tm *tp; time_t t; - + for (; p; p = p->next) { first = 1; @@ -893,14 +893,14 @@ static void pgpring_dump_keyblock (pgp_key_t p) else printf ("sec:"); } - else + else { if (p->flags & KEYFLAG_SUBKEY) printf ("sub:"); else printf ("pub:"); } - + if (p->flags & KEYFLAG_REVOKED) putchar ('r'); if (p->flags & KEYFLAG_EXPIRED) @@ -928,7 +928,7 @@ static void pgpring_dump_keyblock (pgp_key_t p) printf (":%d:%d:%s:%04d-%02d-%02d::::", p->keylen, p->numalg, p->keyid, 1900 + tp->tm_year, tp->tm_mon + 1, tp->tm_mday); - + print_userid (uid->addr); printf ("::"); @@ -940,10 +940,10 @@ static void pgpring_dump_keyblock (pgp_key_t p) putchar ('D'); printf (":\n"); - if (dump_fingerprints) + if (dump_fingerprints) print_fingerprint (p); } - + if (dump_signatures) { if (first) pgpring_dump_signatures (p->sigs); diff --git a/pop.c b/pop.c index 6a50fcb26..b75a1b921 100644 --- a/pop.c +++ b/pop.c @@ -1,21 +1,21 @@ /* * Copyright (C) 2000-2002 Vsevolod Volkov * Copyright (C) 2006-2007,2009 Rocco Rutte - * + * * 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" @@ -334,7 +334,7 @@ static int pop_fetch_headers (CONTEXT *ctx) #if USE_HCACHE else { - mutt_hcache_store (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data), + mutt_hcache_store (hc, ctx->hdrs[i]->data, strlen(ctx->hdrs[i]->data), ctx->hdrs[i], 0); } #endif @@ -544,7 +544,7 @@ static int pop_fetch_message (CONTEXT* ctx, MESSAGE* msg, int msgno) msg->fp = fopen (cache->path, "r"); if (msg->fp) return 0; - + mutt_perror (cache->path); mutt_sleep (2); return -1; diff --git a/pop.h b/pop.h index 55e99eecc..26cefb571 100644 --- a/pop.h +++ b/pop.h @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2003 Vsevolod Volkov - * + * * 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. - */ + */ #ifndef _POP_H #define _POP_H 1 diff --git a/pop_auth.c b/pop_auth.c index b63c075f4..1f84efe9b 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -1,16 +1,16 @@ /* * Copyright (C) 2000-2001 Vsevolod Volkov - * + * * 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. @@ -283,7 +283,7 @@ static pop_auth_res_t pop_auth_user (POP_DATA *pop_data, const char *method) if (ret == 0) { snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass); - ret = pop_query_d (pop_data, buf, sizeof (buf), + ret = pop_query_d (pop_data, buf, sizeof (buf), #ifdef DEBUG /* don't print the password unless we're at the ungodly debugging level */ debuglevel < MUTT_SOCK_LOG_FULL ? "PASS *\r\n" : diff --git a/pop_lib.c b/pop_lib.c index 3469df733..ddd30a737 100644 --- a/pop_lib.c +++ b/pop_lib.c @@ -1,16 +1,16 @@ /* * Copyright (C) 2000-2003 Vsevolod Volkov - * + * * 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. diff --git a/protos.h b/protos.h index 1ac1e4c88..9ebd0c4d9 100644 --- a/protos.h +++ b/protos.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2007,2010,2013 Michael R. Elkins * Copyright (C) 2013 Karel Zak - * + * * 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. - */ + */ #ifdef HAVE_INTTYPES_H @@ -60,7 +60,7 @@ int _mutt_aside_thread (HEADER *, short, short); #define mutt_collapse_thread(x,y) _mutt_traverse_thread (x,y,MUTT_THREAD_COLLAPSE) #define mutt_uncollapse_thread(x,y) _mutt_traverse_thread (x,y,MUTT_THREAD_UNCOLLAPSE) -#define mutt_get_hidden(x,y)_mutt_traverse_thread (x,y,MUTT_THREAD_GET_HIDDEN) +#define mutt_get_hidden(x,y)_mutt_traverse_thread (x,y,MUTT_THREAD_GET_HIDDEN) #define mutt_thread_contains_unread(x,y) _mutt_traverse_thread (x,y,MUTT_THREAD_UNREAD) #define mutt_thread_next_unread(x,y) _mutt_traverse_thread(x,y,MUTT_THREAD_NEXT_UNREAD) int _mutt_traverse_thread (CONTEXT *ctx, HEADER *hdr, int flag); @@ -363,7 +363,7 @@ int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_pattern_func (int, char *); -int mutt_pipe_attachment (FILE *, BODY *, const char *, char *); +int mutt_pipe_attachment (FILE *, BODY *, const char *, char *); int mutt_print_attachment (FILE *, BODY *); int mutt_query_complete (char *, size_t); int mutt_query_variables (LIST *queries); diff --git a/query.c b/query.c index ad61b95cd..d1cbfe3d3 100644 --- a/query.c +++ b/query.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2003,2013 Michael R. Elkins - * + * * 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" @@ -60,13 +60,13 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf); static ADDRESS *result_to_addr (QUERY *r) { static ADDRESS *tmp; - + if (!(tmp = rfc822_cpy_adr (r->addr, 0))) return NULL; - + if(!tmp->next && !tmp->personal) tmp->personal = safe_strdup (r->name); - + mutt_addrlist_to_intl (tmp, NULL); return tmp; } @@ -154,7 +154,7 @@ static QUERY *run_query (char *s, int quiet) if (!quiet) mutt_message ("%s", msg); } - + return first; } @@ -168,7 +168,7 @@ static int query_search (MUTTMENU *m, regex_t *re, int n) return 0; if (table[n].data->addr) { - if (table[n].data->addr->personal && + if (table[n].data->addr->personal && !regexec (re, table[n].data->addr->personal, 0, NULL, 0)) return 0; if (table[n].data->addr->mailbox && @@ -180,7 +180,7 @@ static int query_search (MUTTMENU *m, regex_t *re, int n) return 0; #endif } - + return REG_NOMATCH; } @@ -251,7 +251,7 @@ static int query_tag (MUTTMENU *menu, int n, int m) { ENTRY *cur = &((ENTRY *) menu->data)[n]; int ot = cur->tagged; - + cur->tagged = m >= 0 ? m : !cur->tagged; return cur->tagged - ot; } @@ -399,7 +399,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) { menu->data = QueryTable = safe_calloc (menu->max, sizeof (ENTRY)); - for (i = 0, queryp = results; queryp; + for (i = 0, queryp = results; queryp; queryp = queryp->next, i++) QueryTable[i].data = queryp; } @@ -412,7 +412,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) menu->data = QueryTable; - for (i = 0, queryp = results; queryp; + for (i = 0, queryp = results; queryp; queryp = queryp->next, i++) { /* once we hit new entries, clear/init the tag */ @@ -493,7 +493,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) int tagged = 0; size_t curpos = 0; - memset (buf, 0, buflen); + memset (buf, 0, buflen); /* check for tagged entries */ for (i = 0; i < menu->max; i++) @@ -529,12 +529,12 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf) rfc822_write_address (buf, buflen, tmpa, 0); rfc822_free_address (&tmpa); } - + } free_query (&results); FREE (&QueryTable); - + /* tell whoever called me to redraw the screen when I return */ set_option (OPTNEEDREDRAW); } diff --git a/recvattach.c b/recvattach.c index 66d54c88c..76207c305 100644 --- a/recvattach.c +++ b/recvattach.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2002,2007,2010 Michael R. Elkins * Copyright (C) 1999-2006 Thomas Roessler - * + * * 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" @@ -109,7 +109,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY *m, { ATTACHPTR *new; int i; - + for (; m; m = m->next) { if (*idxlen == *idxmax) @@ -138,7 +138,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY *m, new->level = level; /* We don't support multipart messages in the compose menu yet */ - if (!compose && !m->collapsed && + if (!compose && !m->collapsed && ((m->type == TYPEMULTIPART && (!(WithCrypto & APPLICATION_PGP) || !mutt_is_multipart_encrypted (m)) @@ -170,7 +170,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY *m, * %M = MIME subtype * %n = attachment number * %s = size - * %u = unlink + * %u = unlink */ const char *mutt_attach_fmt (char *dest, size_t destlen, @@ -190,7 +190,7 @@ const char *mutt_attach_fmt (char *dest, ATTACHPTR *aptr = (ATTACHPTR *) data; int optional = (flags & MUTT_FORMAT_OPTIONAL); size_t l; - + switch (op) { case 'C': @@ -243,7 +243,7 @@ const char *mutt_attach_fmt (char *dest, break; } } - else if(aptr->content->description || + else if(aptr->content->description || (mutt_is_message_type (aptr->content->type, aptr->content->subtype) && MsgFmt && aptr->content->hdr)) break; @@ -269,7 +269,7 @@ const char *mutt_attach_fmt (char *dest, if (aptr->content->filename && *aptr->content->filename == '/') { char path[_POSIX_PATH_MAX]; - + strfcpy (path, aptr->content->filename, sizeof (path)); mutt_pretty_mailbox (path, sizeof (path)); mutt_format_s (dest, destlen, prefix, path); @@ -342,7 +342,7 @@ const char *mutt_attach_fmt (char *dest, } else l = aptr->content->length; - + if(!optional) { mutt_pretty_size (tmp, sizeof(tmp), l); @@ -382,7 +382,7 @@ const char *mutt_attach_fmt (char *dest, default: *dest = 0; } - + if (optional) mutt_FormatString (dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0); else if (flags & MUTT_FORMAT_OPTIONAL) @@ -399,7 +399,7 @@ int mutt_tag_attach (MUTTMENU *menu, int n, int m) { BODY *cur = ((ATTACHPTR **) menu->data)[n]->content; int ot = cur->tagged; - + cur->tagged = (m >= 0 ? m : !cur->tagged); return cur->tagged - ot; } @@ -438,8 +438,8 @@ static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char * int is_message; int append = 0; int rc; - - if (body->filename) + + if (body->filename) { if (directory && *directory) mutt_concat_path (buf, *directory, mutt_basename (body->filename), sizeof (buf)); @@ -465,26 +465,26 @@ static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char * mutt_clear_error (); return -1; } - + prompt = NULL; mutt_expand_path (buf, sizeof (buf)); - - is_message = (fp && - body->hdr && - body->encoding != ENCBASE64 && - body->encoding != ENCQUOTEDPRINTABLE && + + is_message = (fp && + body->hdr && + body->encoding != ENCBASE64 && + body->encoding != ENCQUOTEDPRINTABLE && mutt_is_message_type (body->type, body->subtype)); - + if (is_message) { struct stat st; - + /* check to make sure that this file is really the one the user wants */ if ((rc = mutt_save_confirm (buf, &st)) == 1) { prompt = _("Save to file: "); continue; - } + } else if (rc == -1) return -1; strfcpy(tfile, buf, sizeof(tfile)); @@ -499,7 +499,7 @@ static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char * continue; } } - + mutt_message (_("Saving...")); if (mutt_save_attachment (fp, body, tfile, append, (hdr || !is_message) ? hdr : body->hdr) == 0) { @@ -514,7 +514,7 @@ static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char * } return 0; } - + void mutt_save_attachment_list (FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTMENU *menu) { char buf[_POSIX_PATH_MAX], tfile[_POSIX_PATH_MAX]; @@ -562,7 +562,7 @@ void mutt_save_attachment_list (FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTM } } } - else + else { if (tag && menu && top->aptr) { @@ -592,7 +592,7 @@ void mutt_save_attachment_list (FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTM menu_check_recenter (menu); menu->redraw |= REDRAW_MOTION; } - + if (!option (OPTATTACHSPLIT) && (rc == 0)) mutt_message (_("Attachment saved.")); } @@ -791,7 +791,7 @@ static void print_attachment_list (FILE *fp, int tag, BODY *top, STATE *state) void mutt_print_attachment_list (FILE *fp, int tag, BODY *top) { STATE state; - + pid_t thepid; if (query_quadoption (OPT_PRINT, tag ? _("Print tagged attachment(s)?") : _("Print attachment?")) != MUTT_YES) return; @@ -823,7 +823,7 @@ mutt_update_attach_index (BODY *cur, ATTACHPTR ***idxp, *idxlen = 0; idx = *idxp = mutt_gen_attach_list (cur, -1, idx, idxlen, idxmax, 0, 0); - + menu->max = *idxlen; menu->data = *idxp; @@ -831,7 +831,7 @@ mutt_update_attach_index (BODY *cur, ATTACHPTR ***idxp, menu->current = menu->max - 1; menu_check_recenter (menu); menu->redraw |= REDRAW_INDEX; - + } @@ -845,7 +845,7 @@ mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, int old_optweed = option (OPTWEED); set_option (OPTWEED); #endif - + do { switch (op) @@ -937,7 +937,7 @@ void mutt_attach_init (BODY *b) { b->tagged = 0; b->collapsed = 0; - if (b->parts) + if (b->parts) mutt_attach_init (b->parts); } } @@ -969,12 +969,12 @@ void mutt_view_attachments (HEADER *hdr) short idxmax = 0; int flags = 0; int op = OP_NULL; - + /* make sure we have parsed this message */ mutt_parse_mime_message (Context, hdr); mutt_message_hook (Context, hdr, MUTT_MESSAGEHOOK); - + if ((msg = mx_open_message (Context, hdr->msgno)) == NULL) return; @@ -998,16 +998,16 @@ void mutt_view_attachments (HEADER *hdr) { secured = ! crypt_smime_decrypt_mime (msg->fp, &fp, hdr->content, &cur); - + /* S/MIME nesting */ if ((mutt_is_application_smime (cur) & SMIMEOPAQUE)) { BODY *_cur = cur; FILE *_fp = fp; - + fp = NULL; cur = NULL; secured = !crypt_smime_decrypt_mime (_fp, &fp, _cur, &cur); - + mutt_free_body (&_cur); safe_fclose (&_fp); } @@ -1031,7 +1031,7 @@ void mutt_view_attachments (HEADER *hdr) return; } } - + if (!WithCrypto || !need_secured) { fp = msg->fp; @@ -1086,7 +1086,7 @@ void mutt_view_attachments (HEADER *hdr) attach_collapse (idx[menu->current]->content, 0, 1, 1); mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu); break; - + case OP_FORGET_PASSPHRASE: crypt_forget_passphrase (); break; @@ -1094,12 +1094,12 @@ void mutt_view_attachments (HEADER *hdr) case OP_EXTRACT_KEYS: if ((WithCrypto & APPLICATION_PGP)) { - crypt_pgp_extract_keys_from_attachment_list (fp, menu->tagprefix, + crypt_pgp_extract_keys_from_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content); menu->redraw = REDRAW_FULL; } break; - + case OP_CHECK_TRADITIONAL: if ((WithCrypto & APPLICATION_PGP) && crypt_pgp_check_traditional (fp, menu->tagprefix ? cur @@ -1112,22 +1112,22 @@ void mutt_view_attachments (HEADER *hdr) break; case OP_PRINT: - mutt_print_attachment_list (fp, menu->tagprefix, + mutt_print_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content); break; case OP_PIPE: - mutt_pipe_attachment_list (fp, menu->tagprefix, + mutt_pipe_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content, 0); break; case OP_SAVE: - mutt_save_attachment_list (fp, menu->tagprefix, + mutt_save_attachment_list (fp, menu->tagprefix, menu->tagprefix ? cur : idx[menu->current]->content, hdr, menu); if (!menu->tagprefix && option (OPTRESOLVE) && menu->current < menu->max - 1) menu->current++; - + menu->redraw = REDRAW_MOTION_RESYNCH | REDRAW_FULL; break; @@ -1235,7 +1235,7 @@ void mutt_view_attachments (HEADER *hdr) menu->tagprefix ? NULL : idx[menu->current]->content); menu->redraw = REDRAW_FULL; break; - + case OP_BOUNCE_MESSAGE: CHECK_ATTACH; mutt_attach_bounce (fp, hdr, idx, idxlen, @@ -1249,7 +1249,7 @@ void mutt_view_attachments (HEADER *hdr) menu->tagprefix ? NULL : idx[menu->current]->content, 0); menu->redraw = REDRAW_FULL; break; - + #ifdef USE_NNTP case OP_FORWARD_TO_GROUP: CHECK_ATTACH; @@ -1278,11 +1278,11 @@ void mutt_view_attachments (HEADER *hdr) case OP_LIST_REPLY: CHECK_ATTACH; - - flags = SENDREPLY | + + flags = SENDREPLY | (op == OP_GROUP_REPLY ? SENDGROUPREPLY : 0) | (op == OP_LIST_REPLY ? SENDLISTREPLY : 0); - mutt_attach_reply (fp, hdr, idx, idxlen, + mutt_attach_reply (fp, hdr, idx, idxlen, menu->tagprefix ? NULL : idx[menu->current]->content, flags); menu->redraw = REDRAW_FULL; break; diff --git a/recvcmd.c b/recvcmd.c index bf2b70358..08c03ae98 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -1,22 +1,22 @@ /* * Copyright (C) 1999-2004 Thomas Roessler - * + * * 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. + * Boston, MA 02110-1301, USA. */ #if HAVE_CONFIG_H @@ -70,7 +70,7 @@ static short check_all_msg (ATTACHPTR ** idx, short idxlen, /* can we decode all tagged attachments? */ -static short check_can_decode (ATTACHPTR ** idx, short idxlen, +static short check_can_decode (ATTACHPTR ** idx, short idxlen, BODY * cur) { short i; @@ -89,11 +89,11 @@ static short count_tagged (ATTACHPTR **idx, short idxlen) { short count = 0; short i; - + for (i = 0; i < idxlen; i++) if (idx[i]->content->tagged) count++; - + return count; } @@ -101,7 +101,7 @@ static short count_tagged (ATTACHPTR **idx, short idxlen) * attachment. */ -static short count_tagged_children (ATTACHPTR ** idx, +static short count_tagged_children (ATTACHPTR ** idx, short idxlen, short i) { short level = idx[i]->level; @@ -122,7 +122,7 @@ static short count_tagged_children (ATTACHPTR ** idx, ** **/ -void mutt_attach_bounce (FILE * fp, HEADER * hdr, +void mutt_attach_bounce (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, short idxlen, BODY * cur) { short i; @@ -173,7 +173,7 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, strfcpy (prompt, _("Bounce tagged messages to: "), sizeof (prompt)); buf[0] = '\0'; - if (mutt_get_field (prompt, buf, sizeof (buf), MUTT_ALIAS) + if (mutt_get_field (prompt, buf, sizeof (buf), MUTT_ALIAS) || buf[0] == '\0') return; @@ -184,7 +184,7 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, } adr = mutt_expand_aliases (adr); - + if (mutt_addrlist_to_intl (adr, &err) < 0) { mutt_error (_("Bad IDN: '%s'"), err); @@ -192,7 +192,7 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, rfc822_free_address (&adr); return; } - + buf[0] = 0; rfc822_write_address (buf, sizeof (buf), adr, 1); @@ -200,9 +200,9 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, /* * See commands.c. */ - snprintf (prompt, sizeof (prompt) - 4, + snprintf (prompt, sizeof (prompt) - 4, (p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf); - + if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space) { mutt_format_string (prompt, sizeof (prompt) - 4, @@ -220,9 +220,9 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, mutt_message (p ? _("Message not bounced.") : _("Messages not bounced.")); return; } - + mutt_window_clearline (MuttMessageWindow, 0); - + if (cur) ret = mutt_bounce_message (fp, cur->hdr, adr); else @@ -245,12 +245,12 @@ void mutt_attach_bounce (FILE * fp, HEADER * hdr, /** ** - ** resend-message, from the attachment menu + ** resend-message, from the attachment menu ** ** **/ -void mutt_attach_resend (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, +void mutt_attach_resend (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, short idxlen, BODY * cur) { short i; @@ -271,10 +271,10 @@ void mutt_attach_resend (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, /** ** - ** forward-message, from the attachment menu + ** forward-message, from the attachment menu ** **/ - + /* try to find a common parent message for the tagged attachments. */ static HEADER *find_common_parent (ATTACHPTR ** idx, short idxlen, @@ -286,7 +286,7 @@ static HEADER *find_common_parent (ATTACHPTR ** idx, short idxlen, for (i = 0; i < idxlen; i++) if (idx[i]->content->tagged) break; - + while (--i >= 0) { if (mutt_is_message_type (idx[i]->content->type, idx[i]->content->subtype)) @@ -300,11 +300,11 @@ static HEADER *find_common_parent (ATTACHPTR ** idx, short idxlen, return NULL; } -/* +/* * check whether attachment #i is a parent of the attachment * pointed to by cur - * - * Note: This and the calling procedure could be optimized quite a + * + * Note: This and the calling procedure could be optimized quite a * bit. For now, it's not worth the effort. */ @@ -325,12 +325,12 @@ static HEADER *find_parent (ATTACHPTR **idx, short idxlen, BODY *cur, short natt { short i; HEADER *parent = NULL; - + if (cur) { for (i = 0; i < idxlen; i++) { - if (mutt_is_message_type (idx[i]->content->type, idx[i]->content->subtype) + if (mutt_is_message_type (idx[i]->content->type, idx[i]->content->subtype) && is_parent (i, idx, idxlen, cur)) parent = idx[i]->content->hdr; if (idx[i]->content == cur) @@ -339,7 +339,7 @@ static HEADER *find_parent (ATTACHPTR **idx, short idxlen, BODY *cur, short natt } else if (nattach) parent = find_common_parent (idx, idxlen, nattach); - + return parent; } @@ -349,7 +349,7 @@ static void include_header (int quote, FILE * ifp, { int chflags = CH_DECODE; char prefix[SHORT_STRING]; - + if (option (OPTWEED)) chflags |= CH_WEED | CH_REORDER; @@ -358,31 +358,31 @@ static void include_header (int quote, FILE * ifp, if (_prefix) strfcpy (prefix, _prefix, sizeof (prefix)); else if (!option (OPTTEXTFLOWED)) - _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), + _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, hdr, 0); else strfcpy (prefix, ">", sizeof (prefix)); chflags |= CH_PREFIX; } - + mutt_copy_header (ifp, hdr, ofp, chflags, quote ? prefix : NULL); } -/* Attach all the body parts which can't be decoded. +/* Attach all the body parts which can't be decoded. * This code is shared by forwarding and replying. */ static BODY ** copy_problematic_attachments (FILE *fp, - BODY **last, - ATTACHPTR **idx, + BODY **last, + ATTACHPTR **idx, short idxlen, short force) { short i; - + for (i = 0; i < idxlen; i++) { - if (idx[i]->content->tagged && + if (idx[i]->content->tagged && (force || !mutt_can_decode (idx[i]->content))) { if (mutt_copy_body (fp, last, idx[i]->content) == -1) @@ -393,8 +393,8 @@ static BODY ** copy_problematic_attachments (FILE *fp, return last; } -/* - * forward one or several MIME bodies +/* + * forward one or several MIME bodies * (non-message types) */ @@ -418,7 +418,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, STATE st; - /* + /* * First, find the parent message. * Note: This could be made an option by just * putting the following lines into an if block. @@ -426,7 +426,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, parent = find_parent (idx, idxlen, cur, nattach); - + if (parent == NULL) parent = hdr; @@ -455,32 +455,32 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, else strfcpy (prefix, ">", sizeof (prefix)); } - + include_header (option (OPTFORWQUOTE), fp, parent, tmpfp, prefix); - /* + /* * Now, we have prepared the first part of the message body: The - * original message's header. + * original message's header. * * The next part is more interesting: either include the message bodies, * or attach them. */ if ((!cur || mutt_can_decode (cur)) && - (rc = query_quadoption (OPT_MIMEFWD, + (rc = query_quadoption (OPT_MIMEFWD, _("Forward as attachments?"))) == MUTT_YES) mime_fwd_all = 1; else if (rc == -1) goto bail; - /* - * shortcut MIMEFWDREST when there is only one attachment. Is + /* + * shortcut MIMEFWDREST when there is only one attachment. Is * this intuitive? */ - if (!mime_fwd_all && !cur && (nattach > 1) + if (!mime_fwd_all && !cur && (nattach > 1) && !check_can_decode (idx, idxlen, cur)) { if ((rc = query_quadoption (OPT_MIMEFWDREST, @@ -491,9 +491,9 @@ _("Can't decode all tagged attachments. MIME-forward the others?"))) == MUTT_AB } /* initialize a state structure */ - + memset (&st, 0, sizeof (st)); - + if (option (OPTFORWQUOTE)) st.prefix = prefix; st.flags = MUTT_CHARCONV; @@ -537,22 +537,22 @@ _("Can't decode all tagged attachments. MIME-forward the others?"))) == MUTT_AB } } - if (mime_fwd_any && + if (mime_fwd_any && copy_problematic_attachments (fp, last, idx, idxlen, mime_fwd_all) == NULL) goto bail; } - + mutt_forward_trailer (tmpfp); - + safe_fclose (&tmpfp); tmpfp = NULL; /* now that we have the template, send it. */ ci_send_message (flags, tmphdr, tmpbody, NULL, parent); return; - + bail: - + if (tmpfp) { safe_fclose (&tmpfp); @@ -563,18 +563,18 @@ _("Can't decode all tagged attachments. MIME-forward the others?"))) == MUTT_AB } -/* - * Forward one or several message-type attachments. This +/* + * Forward one or several message-type attachments. This * is different from the previous function * since we want to mimic the index menu's behavior. * * Code reuse from ci_send_message is not possible here - * ci_send_message relies on a context structure to find messages, * while, on the attachment menu, messages are referenced through - * the attachment index. + * the attachment index. */ -static void attach_forward_msgs (FILE * fp, HEADER * hdr, +static void attach_forward_msgs (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, short idxlen, BODY * cur, int flags) { HEADER *curhdr = NULL; @@ -588,7 +588,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, int cmflags = 0; int chflags = CH_XMIT; - + if (cur) curhdr = cur->hdr; else @@ -608,12 +608,12 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, tmpbody[0] = '\0'; - if ((rc = query_quadoption (OPT_MIMEFWD, + if ((rc = query_quadoption (OPT_MIMEFWD, _("Forward MIME encapsulated?"))) == MUTT_NO) { - + /* no MIME encapsulation */ - + mutt_mktemp (tmpbody, sizeof (tmpbody)); if (!(tmpfp = safe_fopen (tmpbody, "w"))) { @@ -637,11 +637,11 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, cmflags |= MUTT_CM_WEED; } } - - + + if (cur) { - /* mutt_message_hook (cur->hdr, MUTT_MESSAGEHOOK); */ + /* mutt_message_hook (cur->hdr, MUTT_MESSAGEHOOK); */ mutt_forward_intro (tmpfp, cur->hdr); _mutt_copy_message (tmpfp, fp, cur->hdr, cur->hdr->content, cmflags, chflags); mutt_forward_trailer (tmpfp); @@ -652,7 +652,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, { if (idx[i]->content->tagged) { - /* mutt_message_hook (idx[i]->content->hdr, MUTT_MESSAGEHOOK); */ + /* mutt_message_hook (idx[i]->content->hdr, MUTT_MESSAGEHOOK); */ mutt_forward_intro (tmpfp, idx[i]->content->hdr); _mutt_copy_message (tmpfp, fp, idx[i]->content->hdr, idx[i]->content->hdr->content, cmflags, chflags); @@ -680,16 +680,16 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, else mutt_free_header (&tmphdr); - ci_send_message (flags, tmphdr, *tmpbody ? tmpbody : NULL, + ci_send_message (flags, tmphdr, *tmpbody ? tmpbody : NULL, NULL, curhdr); } -void mutt_attach_forward (FILE * fp, HEADER * hdr, +void mutt_attach_forward (FILE * fp, HEADER * hdr, ATTACHPTR ** idx, short idxlen, BODY * cur, int flags) { short nattach; - + if (check_all_msg (idx, idxlen, cur, 0) == 0) attach_forward_msgs (fp, hdr, idx, idxlen, cur, flags); @@ -703,7 +703,7 @@ void mutt_attach_forward (FILE * fp, HEADER * hdr, /** - ** + ** ** the various reply functions, from the attachment menu ** ** @@ -712,16 +712,16 @@ void mutt_attach_forward (FILE * fp, HEADER * hdr, /* Create the envelope defaults for a reply. * * This function can be invoked in two ways. - * + * * Either, parent is NULL. In this case, all tagged bodies are of a message type, * and the header information is fetched from them. - * + * * Or, parent is non-NULL. In this case, cur is the common parent of all the * tagged attachments. - * + * * Note that this code is horribly similar to envelope_defaults () from send.c. */ - + static int attach_reply_envelope_defaults (ENVELOPE *env, ATTACHPTR **idx, short idxlen, HEADER *parent, int flags) @@ -729,7 +729,7 @@ attach_reply_envelope_defaults (ENVELOPE *env, ATTACHPTR **idx, short idxlen, ENVELOPE *curenv = NULL; HEADER *curhdr = NULL; short i; - + if (!parent) { for (i = 0; i < idxlen; i++) @@ -795,14 +795,14 @@ attach_reply_envelope_defaults (ENVELOPE *env, ATTACHPTR **idx, short idxlen, else { LIST **p = NULL, **q = NULL; - + for (i = 0; i < idxlen; i++) { if (idx[i]->content->tagged) mutt_add_to_reference_headers (env, idx[i]->content->hdr->env, &p, &q); } } - + return 0; } @@ -814,10 +814,10 @@ static void attach_include_reply (FILE *fp, FILE *tmpfp, HEADER *cur, int flags) int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV; int chflags = CH_DECODE; - /* mutt_message_hook (cur, MUTT_MESSAGEHOOK); */ - + /* mutt_message_hook (cur, MUTT_MESSAGEHOOK); */ + mutt_make_attribution (Context, cur, tmpfp); - + if (!option (OPTHEADER)) cmflags |= MUTT_CM_NOHEADER; if (option (OPTWEED)) @@ -829,13 +829,13 @@ static void attach_include_reply (FILE *fp, FILE *tmpfp, HEADER *cur, int flags) _mutt_copy_message (tmpfp, fp, cur, cur->content, cmflags, chflags); mutt_make_post_indent (Context, cur, tmpfp); } - -void mutt_attach_reply (FILE * fp, HEADER * hdr, - ATTACHPTR ** idx, short idxlen, BODY * cur, + +void mutt_attach_reply (FILE * fp, HEADER * hdr, + ATTACHPTR ** idx, short idxlen, BODY * cur, int flags) { short mime_reply_any = 0; - + short nattach = 0; HEADER *parent = NULL; HEADER *tmphdr = NULL; @@ -844,10 +844,10 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, STATE st; char tmpbody[_POSIX_PATH_MAX]; FILE *tmpfp; - + char prefix[SHORT_STRING]; int rc; - + #ifdef USE_NNTP if (flags & SENDNEWS) set_option (OPTNEWSSEND); @@ -876,13 +876,13 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, tmphdr = mutt_new_header (); tmphdr->env = mutt_new_envelope (); - if (attach_reply_envelope_defaults (tmphdr->env, idx, idxlen, + if (attach_reply_envelope_defaults (tmphdr->env, idx, idxlen, parent ? parent : (cur ? cur->hdr : NULL), flags) == -1) { mutt_free_header (&tmphdr); return; } - + mutt_mktemp (tmpbody, sizeof (tmpbody)); if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) { @@ -907,21 +907,21 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, else { mutt_make_attribution (Context, parent, tmpfp); - + memset (&st, 0, sizeof (STATE)); st.fpin = fp; st.fpout = tmpfp; if (!option (OPTTEXTFLOWED)) - _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), + _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, parent, 0); else strfcpy (prefix, ">", sizeof (prefix)); st.prefix = prefix; st.flags = MUTT_CHARCONV; - - if (option (OPTWEED)) + + if (option (OPTWEED)) st.flags |= MUTT_WEED; if (option (OPTHEADER)) @@ -951,7 +951,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, mutt_make_post_indent (Context, parent, tmpfp); - if (mime_reply_any && !cur && + if (mime_reply_any && !cur && copy_problematic_attachments (fp, &tmphdr->content, idx, idxlen, 0) == NULL) { mutt_free_header (&tmphdr); @@ -961,7 +961,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, } safe_fclose (&tmpfp); - + if (ci_send_message (flags, tmphdr, tmpbody, NULL, parent ? parent : (cur ? cur->hdr : NULL)) == 0) mutt_set_flag (Context, hdr, MUTT_REPLIED, 1); diff --git a/regex.c b/regex.c index 9ee1cfecf..410fd84fc 100644 --- a/regex.c +++ b/regex.c @@ -2,31 +2,31 @@ * version 0.12. * (Implements POSIX draft P1003.2/D11.2, except for some of the * internationalization features.) - * + * * Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. - * + * * This file is part of the GNU C Library. Its master source is NOT part of * the C library, however. The master source lives in /gd/gnu/lib. - * + * * The GNU C Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * The GNU C Library 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 * Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with the GNU C Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Boston, MA 02110-1301, USA. */ /* * Modifications: - * + * * Use _regex.h instead of regex.h. tlr, 1999-01-06 * Make REGEX_MALLOC depend on HAVE_ALLOCA &c. * tlr, 1999-02-14 diff --git a/remailer.c b/remailer.c index 12721533d..ff373e4d9 100644 --- a/remailer.c +++ b/remailer.c @@ -1,23 +1,23 @@ /* * Copyright (C) 1999-2001 Thomas Roessler - * + * * 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. - */ + */ /* * Mixmaster support for Mutt @@ -76,11 +76,11 @@ static int mix_get_caps (const char *capstr) case 'C': caps |= MIX_CAP_COMPRESS; break; - + case 'M': caps |= MIX_CAP_MIDDLEMAN; break; - + case 'N': { switch (*++capstr) @@ -88,18 +88,18 @@ static int mix_get_caps (const char *capstr) case 'm': caps |= MIX_CAP_NEWSMAIL; break; - + case 'p': caps |= MIX_CAP_NEWSPOST; break; - + } } } - + if (*capstr) capstr++; } - + return caps; } @@ -111,7 +111,7 @@ static void mix_add_entry (REMAILER ***type2_list, REMAILER *entry, *slots += 5; safe_realloc (type2_list, sizeof (REMAILER *) * (*slots)); } - + (*type2_list)[(*used)++] = entry; if (entry) entry->num = *used; } @@ -126,7 +126,7 @@ static void mix_free_remailer (REMAILER **r) FREE (&(*r)->shortname); FREE (&(*r)->addr); FREE (&(*r)->ver); - + FREE (r); /* __FREE_CHECKED__ */ } @@ -141,18 +141,18 @@ static REMAILER **mix_type2_list (size_t *l) char cmd[HUGE_STRING + _POSIX_PATH_MAX]; char line[HUGE_STRING]; char *t; - + REMAILER **type2_list = NULL, *p; size_t slots = 0, used = 0; if (!l) return NULL; - + if ((devnull = open ("/dev/null", O_RDWR)) == -1) return NULL; - + snprintf (cmd, sizeof (cmd), "%s -T", Mixmaster); - + if ((mm_pid = mutt_create_filter_fd (cmd, NULL, &fp, NULL, devnull, -1, devnull)) == -1) { close (devnull); @@ -160,25 +160,25 @@ static REMAILER **mix_type2_list (size_t *l) } /* first, generate the "random" remailer */ - + p = mix_new_remailer (); p->shortname = safe_strdup (_("")); mix_add_entry (&type2_list, p, &slots, &used); - + while (fgets (line, sizeof (line), fp)) { p = mix_new_remailer (); - + if (!(t = strtok (line, " \t\n"))) goto problem; - + p->shortname = safe_strdup (t); - + if (!(t = strtok (NULL, " \t\n"))) goto problem; p->addr = safe_strdup (t); - + if (!(t = strtok (NULL, " \t\n"))) goto problem; @@ -186,26 +186,26 @@ static REMAILER **mix_type2_list (size_t *l) goto problem; p->ver = safe_strdup (t); - + if (!(t = strtok (NULL, " \t\n"))) goto problem; p->caps = mix_get_caps (t); - + mix_add_entry (&type2_list, p, &slots, &used); continue; - + problem: mix_free_remailer (&p); } - + *l = used; mix_add_entry (&type2_list, NULL, &slots, &used); mutt_wait_filter (mm_pid); close (devnull); - + return type2_list; } @@ -213,10 +213,10 @@ static void mix_free_type2_list (REMAILER ***ttlp) { int i; REMAILER **type2_list = *ttlp; - + for (i = 0; type2_list[i]; i++) mix_free_remailer (&type2_list[i]); - + FREE (type2_list); /* __FREE_CHECKED__ */ } @@ -236,11 +236,11 @@ static void mix_screen_coordinates (REMAILER **type2_list, if (!chain->cl) return; - + safe_realloc (coordsp, sizeof (struct coord) * chain->cl); - + coords = *coordsp; - + if (i) { c = coords[i-1].c + strlen (type2_list[chain->ch[i-1]]->shortname) + 2; @@ -251,8 +251,8 @@ static void mix_screen_coordinates (REMAILER **type2_list, r = MIX_VOFFSET; c = MIX_HOFFSET; } - - + + for (; i < chain->cl; i++) { oc = c; @@ -263,12 +263,12 @@ static void mix_screen_coordinates (REMAILER **type2_list, oc = c = MIX_HOFFSET; r++; } - + coords[i].c = oc; coords[i].r = r; - + } - + } static void mix_redraw_ce (REMAILER **type2_list, @@ -279,15 +279,15 @@ static void mix_redraw_ce (REMAILER **type2_list, { if (!coords || !chain) return; - + if (coords[i].r < MIX_MAXROW) { - + if (selected) SETCOLOR (MT_COLOR_INDICATOR); else NORMAL_COLOR; - + mutt_window_mvaddstr (MuttIndexWindow, coords[i].r, coords[i].c, type2_list[chain->ch[i]]->shortname); NORMAL_COLOR; @@ -303,7 +303,7 @@ static void mix_redraw_chain (REMAILER **type2_list, int cur) { int i; - + for (i = MIX_VOFFSET; i < MIX_MAXROW; i++) { mutt_window_move (MuttIndexWindow, i, 0); @@ -327,17 +327,17 @@ static const char *mix_format_caps (REMAILER *r) { static char capbuff[10]; char *t = capbuff; - + if (r->caps & MIX_CAP_COMPRESS) *t++ = 'C'; else *t++ = ' '; - + if (r->caps & MIX_CAP_MIDDLEMAN) *t++ = 'M'; else *t++ = ' '; - + if (r->caps & MIX_CAP_NEWSPOST) { *t++ = 'N'; @@ -348,7 +348,7 @@ static const char *mix_format_caps (REMAILER *r) *t++ = ' '; *t++ = ' '; } - + if (r->caps & MIX_CAP_NEWSMAIL) { *t++ = 'N'; @@ -359,15 +359,15 @@ static const char *mix_format_caps (REMAILER *r) *t++ = ' '; *t++ = ' '; } - + *t = '\0'; - + return capbuff; } /* * Format an entry for the remailer menu. - * + * * %n number * %c capabilities * %s short name @@ -425,7 +425,7 @@ static const char *mix_entry_fmt (char *dest, else if (!remailer->addr) optional = 0; break; - + default: *dest = '\0'; } @@ -438,7 +438,7 @@ static const char *mix_entry_fmt (char *dest, } - + static void mix_entry (char *b, size_t blen, MUTTMENU *menu, int num) { REMAILER **type2_list = (REMAILER **) menu->data; @@ -446,14 +446,14 @@ static void mix_entry (char *b, size_t blen, MUTTMENU *menu, int num) (unsigned long) type2_list[num], MUTT_FORMAT_ARROWCURSOR); } -static int mix_chain_add (MIXCHAIN *chain, const char *s, +static int mix_chain_add (MIXCHAIN *chain, const char *s, REMAILER **type2_list) { int i; - + if (chain->cl >= MAXMIXES) return -1; - + if (!mutt_strcmp (s, "0") || !ascii_strcasecmp (s, "")) { chain->ch[chain->cl++] = 0; @@ -468,16 +468,16 @@ static int mix_chain_add (MIXCHAIN *chain, const char *s, return 0; } } - + /* replace unknown remailers by */ - + if (!type2_list[i]) chain->ch[chain->cl++] = 0; return 0; } -static const struct mapping_t RemailerHelp[] = +static const struct mapping_t RemailerHelp[] = { { N_("Append"), OP_MIX_APPEND }, { N_("Insert"), OP_MIX_INSERT }, @@ -486,7 +486,7 @@ static const struct mapping_t RemailerHelp[] = { N_("OK"), OP_MIX_USE }, { NULL, 0 } }; - + void mix_make_chain (LIST **chainp, int *redraw) { @@ -494,17 +494,17 @@ void mix_make_chain (LIST **chainp, int *redraw) MIXCHAIN *chain; int c_cur = 0, c_old = 0; short c_redraw = 1; - + REMAILER **type2_list = NULL; size_t ttll = 0; - + struct coord *coords = NULL; - + MUTTMENU *menu; char helpstr[LONG_STRING]; short loop = 1; int op; - + int i, j; char *t; @@ -515,22 +515,22 @@ void mix_make_chain (LIST **chainp, int *redraw) } *redraw = REDRAW_FULL; - + chain = safe_calloc (sizeof (MIXCHAIN), 1); for (p = *chainp; p; p = p->next) mix_chain_add (chain, (char *) p->data, type2_list); mutt_free_list (chainp); - + /* safety check */ for (i = 0; i < chain->cl; i++) { if (chain->ch[i] >= ttll) chain->ch[i] = 0; } - + mix_screen_coordinates (type2_list, &coords, chain, 0); - + menu = mutt_new_menu (MENU_MIX); menu->max = ttll; menu->make_entry = mix_entry; @@ -539,15 +539,15 @@ void mix_make_chain (LIST **chainp, int *redraw) menu->data = type2_list; menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MIX, RemailerHelp); menu->pagelen = MIX_VOFFSET - 1; - - while (loop) + + while (loop) { if (menu->pagelen != MIX_VOFFSET - 1) { menu->pagelen = MIX_VOFFSET - 1; menu->redraw = REDRAW_FULL; } - + if (c_redraw) { mix_redraw_head (chain); @@ -559,9 +559,9 @@ void mix_make_chain (LIST **chainp, int *redraw) mix_redraw_ce (type2_list, coords, chain, c_old, 0); mix_redraw_ce (type2_list, coords, chain, c_cur, 1); } - + c_old = c_cur; - + switch ((op = mutt_menuLoop (menu))) { case OP_REDRAW: @@ -573,7 +573,7 @@ void mix_make_chain (LIST **chainp, int *redraw) menu->pagelen = MIX_VOFFSET - 1; break; } - + case OP_EXIT: { chain->cl = 0; @@ -590,8 +590,8 @@ void mix_make_chain (LIST **chainp, int *redraw) mix_screen_coordinates (type2_list, &coords, chain, c_cur); c_redraw = 1; } - - if (chain->cl && chain->ch[chain->cl - 1] && + + if (chain->cl && chain->ch[chain->cl - 1] && (type2_list[chain->ch[chain->cl-1]]->caps & MIX_CAP_MIDDLEMAN)) { mutt_error (_("Error: %s can't be used as the final remailer of a chain."), @@ -618,7 +618,7 @@ void mix_make_chain (LIST **chainp, int *redraw) chain->cl++; for (i = chain->cl - 1; i > c_cur; i--) chain->ch[i] = chain->ch[i-1]; - + chain->ch[c_cur] = menu->current; mix_screen_coordinates (type2_list, &coords, chain, c_cur); c_redraw = 1; @@ -626,22 +626,22 @@ void mix_make_chain (LIST **chainp, int *redraw) else mutt_error (_("Mixmaster chains are limited to %d elements."), MAXMIXES); - + break; } - + case OP_MIX_DELETE: { if (chain->cl) { chain->cl--; - + for (i = c_cur; i < chain->cl; i++) chain->ch[i] = chain->ch[i+1]; if (c_cur == chain->cl && c_cur) c_cur--; - + mix_screen_coordinates (type2_list, &coords, chain, c_cur); c_redraw = 1; } @@ -651,33 +651,33 @@ void mix_make_chain (LIST **chainp, int *redraw) } break; } - + case OP_MIX_CHAIN_PREV: { - if (c_cur) + if (c_cur) c_cur--; else mutt_error (_("You already have the first chain element selected.")); - + break; } - + case OP_MIX_CHAIN_NEXT: { if (chain->cl && c_cur < chain->cl - 1) c_cur++; else mutt_error (_("You already have the last chain element selected.")); - + break; } } } - + mutt_menuDestroy (&menu); /* construct the remailer list */ - + if (chain->cl) { for (i = 0; i < chain->cl; i++) @@ -686,11 +686,11 @@ void mix_make_chain (LIST **chainp, int *redraw) t = type2_list[j]->shortname; else t = "*"; - + *chainp = mutt_add_list (*chainp, t); } } - + mix_free_type2_list (&type2_list); FREE (&coords); FREE (&chain); @@ -703,7 +703,7 @@ int mix_check_message (HEADER *msg) const char *fqdn; short need_hostname = 0; ADDRESS *p; - + if (msg->env->cc || msg->env->bcc) { mutt_error (_("Mixmaster doesn't accept Cc or Bcc headers.")); @@ -712,7 +712,7 @@ int mix_check_message (HEADER *msg) /* When using mixmaster, we MUST qualify any addresses since * the message will be delivered through remote systems. - * + * * use_domain won't be respected at this point, hidden_host will. */ @@ -724,16 +724,16 @@ int mix_check_message (HEADER *msg) break; } } - + if (need_hostname) { - + if (!(fqdn = mutt_fqdn (1))) { mutt_error (_("Please set the hostname variable to a proper value when using mixmaster!")); return (-1); } - + /* Cc and Bcc are empty at this point. */ rfc822_qualify (msg->env->to, fqdn); rfc822_qualify (msg->env->reply_to, fqdn); @@ -751,7 +751,7 @@ int mix_send_message (LIST *chain, const char *tempfile) int i; snprintf (cmd, sizeof (cmd), "cat %s | %s -m ", tempfile, Mixmaster); - + for (i = 0; chain; chain = chain->next, i = 1) { strfcpy (tmp, cmd, sizeof (tmp)); @@ -761,7 +761,7 @@ int mix_send_message (LIST *chain, const char *tempfile) if (!option (OPTNOCURSES)) mutt_endwin (NULL); - + if ((i = mutt_system (cmd))) { fprintf (stderr, _("Error sending message, child exited %d.\n"), i); @@ -775,6 +775,6 @@ int mix_send_message (LIST *chain, const char *tempfile) unlink (tempfile); return i; } - + #endif diff --git a/remailer.h b/remailer.h index cbae78f3b..a610ba40f 100644 --- a/remailer.h +++ b/remailer.h @@ -3,21 +3,21 @@ /* * Copyright (C) 1999-2000 Thomas Roessler - * + * * 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. - */ + */ /* * Mixmaster support for Mutt diff --git a/resize.c b/resize.c index d71cb34b0..4ed65674a 100644 --- a/resize.c +++ b/resize.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" diff --git a/rfc1524.c b/rfc1524.c index 8f2d6fa70..6f34a911e 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -1,28 +1,28 @@ /* * Copyright (C) 1996-2000,2003,2012 Michael R. Elkins - * + * * 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. - */ + */ -/* +/* * rfc1524 defines a format for the Multimedia Mail Configuration, which - * is the standard mailcap file format under Unix which specifies what + * is the standard mailcap file format under Unix which specifies what * external programs should be used to view/compose/edit multimedia files * based on content type. * - * This file contains various functions for implementing a fair subset of + * This file contains various functions for implementing a fair subset of * rfc1524. */ @@ -62,9 +62,9 @@ int rfc1524_expand_command (BODY *a, char *filename, char *_type, int needspipe = true; char buf[LONG_STRING]; char type[LONG_STRING]; - + strfcpy (type, _type, sizeof (type)); - + if (option (OPTMAILCAPSANITIZE)) mutt_sanitize_filename (type, 0); @@ -75,10 +75,10 @@ int rfc1524_expand_command (BODY *a, char *filename, char *_type, x++; buf[y++] = command[x++]; } - else if (command[x] == '%') + else if (command[x] == '%') { x++; - if (command[x] == '{') + if (command[x] == '{') { char param[STRING]; char pvalue[STRING]; @@ -89,12 +89,12 @@ int rfc1524_expand_command (BODY *a, char *filename, char *_type, while (command[x] && command[x] != '}' && z < sizeof (param) - 1) param[z++] = command[x++]; param[z] = '\0'; - + _pvalue = mutt_get_parameter (param, a->parameter); strfcpy (pvalue, NONULL(_pvalue), sizeof (pvalue)); if (option (OPTMAILCAPSANITIZE)) mutt_sanitize_filename (pvalue, 0); - + y += mutt_quote_filename (buf + y, sizeof (buf) - y, pvalue); } else if (command[x] == 's' && filename != NULL) @@ -159,7 +159,7 @@ static int get_field_text (char *field, char **entry, } return 1; } - else + else { mutt_error (_("Improperly formatted entry for type %s in \"%s\" line %d"), type, filename, line); @@ -169,7 +169,7 @@ static int get_field_text (char *field, char **entry, static int rfc1524_mailcap_parse (BODY *a, char *filename, - char *type, + char *type, rfc1524_entry *entry, int opt) { @@ -286,7 +286,7 @@ static int rfc1524_mailcap_parse (BODY *a, } else if (!ascii_strncasecmp (field, "test", 4)) { - /* + /* * This routine executes the given test command to determine * if this is the right entry. */ @@ -329,7 +329,7 @@ static int rfc1524_mailcap_parse (BODY *a, if (!printcommand) found = false; } - + if (!found) { /* reset */ @@ -386,7 +386,7 @@ int rfc1524_mailcap_lookup (BODY *a, char *type, rfc1524_entry *entry, int opt) char *curr = MailcapPath; /* rfc1524 specifies that a path of mailcap files should be searched. - * joy. They say + * joy. They say * $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap, etc * and overridden by the MAILCAPS environment variable, and, just to be nice, * we'll make it specifiable in .muttrc @@ -412,7 +412,7 @@ int rfc1524_mailcap_lookup (BODY *a, char *type, rfc1524_entry *entry, int opt) if (!x) continue; - + path[x] = '\0'; mutt_expand_path (path, sizeof (path)); @@ -429,11 +429,11 @@ int rfc1524_mailcap_lookup (BODY *a, char *type, rfc1524_entry *entry, int opt) /* This routine will create a _temporary_ filename matching the * name template given if this needs to be done. - * + * * Please note that only the last path element of the * template and/or the old file name will be used for the * comparison and the temporary file name. - * + * * Returns 0 if oldfile is fine as is. * Returns 1 if newfile specified */ @@ -446,27 +446,27 @@ static void strnfcpy(char *d, char *s, size_t siz, size_t len) } int rfc1524_expand_filename (char *nametemplate, - char *oldfile, + char *oldfile, char *newfile, size_t nflen) { int i, j, k, ps; char *s; - short lmatch = 0, rmatch = 0; + short lmatch = 0, rmatch = 0; char left[_POSIX_PATH_MAX]; char right[_POSIX_PATH_MAX]; - + newfile[0] = 0; /* first, ignore leading path components. */ - + if (nametemplate && (s = strrchr (nametemplate, '/'))) nametemplate = s + 1; if (oldfile && (s = strrchr (oldfile, '/'))) oldfile = s + 1; - + if (!nametemplate) { if (oldfile) @@ -479,15 +479,15 @@ int rfc1524_expand_filename (char *nametemplate, else /* oldfile && nametemplate */ { - /* first, compare everything left from the "%s" + /* first, compare everything left from the "%s" * (if there is one). */ - + lmatch = 1; ps = 0; for(i = 0; nametemplate[i]; i++) { if(nametemplate[i] == '%' && nametemplate[i+1] == 's') - { + { ps = 1; break; } @@ -500,22 +500,22 @@ int rfc1524_expand_filename (char *nametemplate, if(ps) { - + /* If we had a "%s", check the rest. */ - - /* now, for the right part: compare everything right from + + /* now, for the right part: compare everything right from * the "%s" to the final part of oldfile. - * + * * The logic here is as follows: - * + * * - We start reading from the end. * - There must be a match _right_ from the "%s", - * thus the i + 2. + * thus the i + 2. * - If there was a left hand match, this stuff * must not be counted again. That's done by the * condition (j >= (lmatch ? i : 0)). */ - + rmatch = 1; for(j = mutt_strlen(oldfile) - 1, k = mutt_strlen(nametemplate) - 1 ; @@ -528,18 +528,18 @@ int rfc1524_expand_filename (char *nametemplate, break; } } - + /* Now, check if we had a full match. */ - + if(k >= i + 2) rmatch = 0; - + if(lmatch) *left = 0; else strnfcpy(left, nametemplate, sizeof(left), i); - + if(rmatch) *right = 0; else strfcpy(right, nametemplate + i + 2, sizeof(right)); - + snprintf(newfile, nflen, "%s%s%s", left, oldfile, right); } else @@ -548,14 +548,14 @@ int rfc1524_expand_filename (char *nametemplate, strfcpy(newfile, nametemplate, nflen); } } - + mutt_adv_mktemp(newfile, nflen); if(rmatch && lmatch) return 0; - else + else return 1; - + } /* If rfc1524_expand_command() is used on a recv'd message, then diff --git a/rfc1524.h b/rfc1524.h index b4657256f..7914d1e23 100644 --- a/rfc1524.h +++ b/rfc1524.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #ifndef _RFC1524_H #define _RFC1524_H diff --git a/rfc2047.c b/rfc2047.c index a25132bc4..a9a93a537 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000,2010 Michael R. Elkins * Copyright (C) 2000-2002 Edmund Grimley Evans - * + * * 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" @@ -77,7 +77,7 @@ static size_t convert_string (ICONV_CONST char *f, size_t flen, return (size_t)(-1); } *ob = '\0'; - + *tlen = ob - buf; safe_realloc (&buf, ob - buf + 1); @@ -182,7 +182,7 @@ char *mutt_choose_charset (const char *fromcode, const char *charsets, *d = e; if (dlen) *dlen = elen; - + mutt_canonical_charset (canonical_buff, sizeof (canonical_buff), tocode); mutt_str_replace (&tocode, canonical_buff); } @@ -406,7 +406,7 @@ static int rfc2047_encode (ICONV_CONST char *d, size_t dlen, int col, /* Try to convert to UTF-8. */ if (convert_string (d, dlen, fromcode, icode, &u, &ulen)) { - ret = 1; + ret = 1; icode = 0; safe_realloc (&u, (ulen = dlen) + 1); memcpy (u, d, dlen); @@ -417,7 +417,7 @@ static int rfc2047_encode (ICONV_CONST char *d, size_t dlen, int col, s0 = s1 = t0 = t1 = 0; for (t = u; t < u + ulen; t++) { - if ((*t & 0x80) || + if ((*t & 0x80) || (*t == '=' && t[1] == '?' && (t == u || HSPACE(*(t-1))))) { if (!t0) t0 = t; @@ -457,12 +457,12 @@ static int rfc2047_encode (ICONV_CONST char *d, size_t dlen, int col, /* Hack to avoid labelling 8-bit data as us-ascii. */ if (!icode && mutt_is_us_ascii (tocode)) tocode = "unknown-8bit"; - + /* Adjust t0 for maximum length of line. */ t = u + (ENCWORD_LEN_MAX + 1) - col - ENCWORD_LEN_MIN; if (t < u) t = u; if (t < t0) t0 = t; - + /* Adjust t0 until we can encode a character after a space. */ for (; t0 > u; t0--) @@ -563,7 +563,7 @@ static int rfc2047_encode (ICONV_CONST char *d, size_t dlen, int col, FREE (&u); buf[buflen] = '\0'; - + *e = buf; *elen = buflen + 1; return ret; @@ -594,7 +594,7 @@ void rfc2047_encode_adrlist (ADDRESS *addr, const char *tag) { ADDRESS *ptr = addr; int col = tag ? strlen (tag) + 2 : 32; - + while (ptr) { if (ptr->personal) @@ -636,7 +636,7 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len) switch (count) { case 2: - /* ignore language specification a la RFC 2231 */ + /* ignore language specification a la RFC 2231 */ t = pp1; if ((t1 = memchr (pp, '*', t - pp))) t = t1; @@ -696,7 +696,7 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len) break; } } - + if (charset) mutt_convert_string (&d0, charset, Charset, MUTT_ICONV_HOOK_FROM); mutt_filter_unprintable (&d0); @@ -894,7 +894,7 @@ void rfc2047_decode_adrlist (ADDRESS *a) { while (a) { - if (a->personal && ((strstr (a->personal, "=?") != NULL) || + if (a->personal && ((strstr (a->personal, "=?") != NULL) || (AssumedCharset && *AssumedCharset))) rfc2047_decode (&a->personal); else if (a->group && a->mailbox && (strstr (a->mailbox, "=?") != NULL)) diff --git a/rfc2047.h b/rfc2047.h index 9e15d2f21..5748b75e3 100644 --- a/rfc2047.h +++ b/rfc2047.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ char *mutt_choose_charset (const char *fromcode, const char *charsets, char *u, size_t ulen, char **d, size_t *dlen); diff --git a/rfc2231.c b/rfc2231.c index 05e81c3db..b2d116365 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -6,13 +6,13 @@ * 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, @@ -23,7 +23,7 @@ * Yet another MIME encoding for header data. This time, it's * parameters, specified in RFC 2231, and modeled after the * encoding used in URLs. - * + * * Additionally, continuations and encoding are mixed in an, errrm, * interesting manner. * @@ -49,7 +49,7 @@ struct rfc2231_parameter char *value; int index; int encoded; - struct rfc2231_parameter + struct rfc2231_parameter *next; }; @@ -63,7 +63,7 @@ static void rfc2231_list_insert (struct rfc2231_parameter **, struct rfc2231_par static void purge_empty_parameters (PARAMETER **headp) { PARAMETER *p, *q, **last; - + for (last = headp, p = *headp; p; p = q) { q = p->next; @@ -96,11 +96,11 @@ void rfc2231_decode_parameters (PARAMETER **headp) short dirty = 0; /* set to 1 when we may have created * empty parameters. */ - + if (!headp) return; purge_empty_parameters (headp); - + for (last = &head, p = *headp; p; p = q) { q = p->next; @@ -108,10 +108,10 @@ void rfc2231_decode_parameters (PARAMETER **headp) if (!(s = strchr (p->attribute, '*'))) { - /* + /* * Using RFC 2047 encoding in MIME parameters is explicitly * forbidden by that document. Nevertheless, it's being - * generated by some software, including certain Lotus Notes to + * generated by some software, including certain Lotus Notes to * Internet Gateways. So we actually decode it. */ @@ -127,7 +127,7 @@ void rfc2231_decode_parameters (PARAMETER **headp) else if (*(s + 1) == '\0') { *s = '\0'; - + s = rfc2231_get_charset (p->value, charset, sizeof (charset)); rfc2231_decode_one (p->value, s); mutt_convert_string (&p->value, charset, Charset, MUTT_ICONV_HOOK_FROM); @@ -136,7 +136,7 @@ void rfc2231_decode_parameters (PARAMETER **headp) *last = p; last = &p->next; p->next = NULL; - + dirty = 1; } else @@ -154,7 +154,7 @@ void rfc2231_decode_parameters (PARAMETER **headp) conttmp->value = p->value; conttmp->encoded = encoded; conttmp->index = index; - + p->attribute = NULL; p->value = NULL; FREE (&p); @@ -168,13 +168,13 @@ void rfc2231_decode_parameters (PARAMETER **headp) rfc2231_join_continuations (last, conthead); dirty = 1; } - + *headp = head; - + if (dirty) purge_empty_parameters (headp); } - + static struct rfc2231_parameter *rfc2231_new_parameter (void) { return safe_calloc (sizeof (struct rfc2231_parameter), 1); @@ -193,16 +193,16 @@ static void rfc2231_free_parameter (struct rfc2231_parameter **p) static char *rfc2231_get_charset (char *value, char *charset, size_t chslen) { char *t, *u; - + if (!(t = strchr (value, '\''))) { charset[0] = '\0'; return value; } - + *t = '\0'; strfcpy (charset, value, chslen); - + if ((u = strchr (t + 1, '\''))) return u + 1; else @@ -225,12 +225,12 @@ static void rfc2231_decode_one (char *dest, char *src) else *d++ = *src; } - + *d = '\0'; } /* insert parameter into an ordered list. - * + * * Primary sorting key: attribute * Secondary sorting key: index */ @@ -270,11 +270,11 @@ static void rfc2231_join_continuations (PARAMETER **head, int encoded; size_t l, vl; - + while (par) { value = NULL; l = 0; - + strfcpy (attribute, par->attribute, sizeof (attribute)); if ((encoded = par->encoded)) @@ -282,13 +282,13 @@ static void rfc2231_join_continuations (PARAMETER **head, else valp = par->value; - do + do { if (encoded && par->encoded) rfc2231_decode_one (par->value, valp); - + vl = strlen (par->value); - + safe_realloc (&value, l + vl + 1); strcpy (value + l, par->value); /* __STRCPY_CHECKED__ */ l += vl; @@ -298,7 +298,7 @@ static void rfc2231_join_continuations (PARAMETER **head, if ((par = q)) valp = par->value; } while (par && !strcmp (par->attribute, attribute)); - + if (value) { if (encoded) @@ -317,9 +317,9 @@ int rfc2231_encode_string (char **pd) char *charset, *s, *t, *e, *d = 0; size_t slen, dlen = 0; - /* + /* * A shortcut to detect pure 7bit data. - * + * * This should prevent the worst when character set handling * is flawed. */ @@ -327,10 +327,10 @@ int rfc2231_encode_string (char **pd) for (s = *pd; *s; s++) if (*s & 0x80) break; - + if (!*s) return 0; - + if (!Charset || !SendCharset || !(charset = mutt_choose_charset (Charset, SendCharset, *pd, strlen (*pd), &d, &dlen))) @@ -375,9 +375,9 @@ int rfc2231_encode_string (char **pd) FREE (pd); /* __FREE_CHECKED__ */ *pd = d; } - + FREE (&charset); - + return encode; } diff --git a/rfc3676.c b/rfc3676.c index bc7ab49b1..640dfc4fc 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -3,22 +3,22 @@ * Copyright (C) 2005 Peter J. Holzer * Copyright (C) 2005-2009 Rocco Rutte * Copyright (C) 2010 Michael R. Elkins - * + * * 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 was originally part of mutt-ng */ diff --git a/rfc3676.h b/rfc3676.h index 6f1a2a184..2e6ed7ca3 100644 --- a/rfc3676.h +++ b/rfc3676.h @@ -2,22 +2,22 @@ * Copyright (C) 2005 Andreas Krennmair * Copyright (C) 2005 Peter J. Holzer * Copyright (C) 2005,2007 Rocco Rutte - * + * * 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 was originally part of mutt-ng */ diff --git a/rfc822.c b/rfc822.c index ff577b812..56d9a54e1 100644 --- a/rfc822.c +++ b/rfc822.c @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 2011-2013 Michael R. Elkins - * + * * 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" @@ -141,7 +141,7 @@ parse_comment (const char *s, char *comment, size_t *commentlen, size_t commentmax) { int level = 1; - + while (*s && level) { if (*s == '(') @@ -356,7 +356,7 @@ add_addrspec (ADDRESS **top, ADDRESS **last, const char *phrase, char *comment, size_t *commentlen, size_t commentmax) { ADDRESS *cur = rfc822_new_address (); - + if (parse_addr_spec (phrase, comment, commentlen, commentmax, cur) == NULL) { rfc822_free_address (&cur); @@ -380,7 +380,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) char comment[LONG_STRING], phrase[LONG_STRING]; size_t phraselen = 0, commentlen = 0; ADDRESS *cur, *last = NULL; - + RFC822Error = 0; last = top; @@ -390,7 +390,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) ws_pending = is_email_wsp (*s); if ((nl = mutt_strlen (s))) nl = s[nl - 1] == '\n'; - + s = skip_email_wsp(s); #ifdef EXACT_ADDRESS begin = s; @@ -536,7 +536,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) ws_pending = is_email_wsp(*s); s = skip_email_wsp(s); } - + if (phraselen) { terminate_buffer (phrase, phraselen); @@ -603,7 +603,7 @@ void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS *addr, size_t len; char *pbuf = buf; char *pc; - + if (!addr) return; @@ -739,7 +739,7 @@ int rfc822_write_address (char *buf, size_t buflen, ADDRESS *addr, int display) { char *pbuf = buf; size_t len = mutt_strlen (buf); - + buflen--; /* save room for the terminal nul */ if (len > 0) @@ -810,7 +810,7 @@ ADDRESS *rfc822_cpy_adr_real (ADDRESS *addr) ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune) { ADDRESS *top = NULL, *last = NULL; - + for (; addr; addr = addr->next) { if (prune && addr->group && (!addr->next || !addr->next->mailbox)) @@ -907,7 +907,7 @@ int main (int argc, char **argv) # else char *str = "a b c "; # endif - + list = rfc822_parse_adrlist (NULL, str); buf[0] = 0; rfc822_write_address (buf, sizeof (buf), list); diff --git a/rfc822.h b/rfc822.h index deddd97a7..f6825900c 100644 --- a/rfc822.h +++ b/rfc822.h @@ -1,21 +1,21 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 2012 Michael R. Elkins - * + * * 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. - */ + */ #ifndef rfc822_h #define rfc822_h diff --git a/safe_asprintf.c b/safe_asprintf.c index 2637ba43c..76bb99bbc 100644 --- a/safe_asprintf.c +++ b/safe_asprintf.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2010 Michael R. Elkins - * + * * 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. - */ + */ #include #include "lib.h" diff --git a/score.c b/score.c index a2718ba1d..36c47bca2 100644 --- a/score.c +++ b/score.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" @@ -147,7 +147,7 @@ void mutt_score_message (CONTEXT *ctx, HEADER *hdr, int upd_ctx) } if (hdr->score < 0) hdr->score = 0; - + if (hdr->score <= ScoreThresholdDelete) _mutt_set_flag (ctx, hdr, MUTT_DELETE, 1, upd_ctx); if (hdr->score <= ScoreThresholdRead) diff --git a/send.c b/send.c index 8ddfe56ff..362a9cb03 100644 --- a/send.c +++ b/send.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2002,2004,2010,2012-2013 Michael R. Elkins - * + * * 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" @@ -159,7 +159,7 @@ static ADDRESS *remove_user (ADDRESS *a, int leave_only) else { ADDRESS *tmp = a; - + a = a->next; if (!leave_only || a || last) { @@ -201,7 +201,7 @@ static int edit_address (ADDRESS **a, /* const */ char *field) char buf[HUGE_STRING]; char *err = NULL; int idna_ok = 0; - + do { buf[0] = 0; @@ -218,7 +218,7 @@ static int edit_address (ADDRESS **a, /* const */ char *field) mutt_sleep (2); FREE (&err); } - } + } while (idna_ok != 0); return 0; } @@ -294,7 +294,7 @@ static int edit_envelope (ENVELOPE *en, int flags) } } } - + if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) != 0 || (!buf[0] && query_quadoption (OPT_SUBJECT, _("No subject, abort?")) != MUTT_NO)) { @@ -396,7 +396,7 @@ static void process_user_header (ENVELOPE *env) void mutt_forward_intro (FILE *fp, HEADER *cur) { char buffer[STRING]; - + fputs ("----- Forwarded message from ", fp); buffer[0] = 0; rfc822_write_address (buffer, sizeof (buffer), cur->env->from, 1); @@ -413,7 +413,7 @@ void mutt_forward_trailer (FILE *fp) static int include_forward (CONTEXT *ctx, HEADER *cur, FILE *out) { int chflags = CH_DECODE, cmflags = 0; - + mutt_parse_mime_message (ctx, cur); mutt_message_hook (ctx, cur, MUTT_MESSAGEHOOK); @@ -483,9 +483,9 @@ static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out) mutt_parse_mime_message (ctx, cur); mutt_message_hook (ctx, cur, MUTT_MESSAGEHOOK); - + mutt_make_attribution (ctx, cur, out); - + if (!option (OPTHEADER)) cmflags |= MUTT_CM_NOHEADER; if (option (OPTWEED)) @@ -497,7 +497,7 @@ static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out) mutt_copy_message (out, ctx, cur, cmflags, chflags); mutt_make_post_indent (ctx, cur, out); - + return 0; } @@ -505,7 +505,7 @@ static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto) { char prompt[STRING]; - if (flags && env->mail_followup_to && hmfupto == MUTT_YES) + if (flags && env->mail_followup_to && hmfupto == MUTT_YES) { rfc822_append (to, env->mail_followup_to, 1); return 0; @@ -533,15 +533,15 @@ static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto) { /* If the Reply-To: address is a mailing list, assume that it was * put there by the mailing list, and use the From: address - * + * * We also take the from header if our correspondent has a reply-to * header which is identical to the electronic mail address given * in his From header, and the reply-to has no display-name. - * + * */ rfc822_append (to, env->from, 0); } - else if (!(mutt_addrcmp (env->from, env->reply_to) && + else if (!(mutt_addrcmp (env->from, env->reply_to) && !env->reply_to->next) && quadoption (OPT_REPLYTO) != MUTT_YES) { @@ -554,7 +554,7 @@ static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto) Asks whether the user respects the reply-to header. If she says no, mutt will reply to the from header's address instead. */ snprintf (prompt, sizeof (prompt), _("Reply to %s%s?"), - env->reply_to->mailbox, + env->reply_to->mailbox, env->reply_to->next?",...":""); switch (query_quadoption (OPT_REPLYTO, prompt)) { @@ -628,7 +628,7 @@ LIST *mutt_make_references(ENVELOPE *e) l = mutt_copy_list (e->references); else l = mutt_copy_list (e->in_reply_to); - + if (e->message_id) { t = mutt_new_list(); @@ -636,7 +636,7 @@ LIST *mutt_make_references(ENVELOPE *e) t->next = l; l = t; } - + return l; } @@ -650,12 +650,12 @@ void mutt_fix_reply_recipients (ENVELOPE *env) env->cc = remove_user (env->cc, (env->to == NULL)); env->to = remove_user (env->to, (env->cc == NULL)); } - + /* the CC field can get cluttered, especially with lists */ env->to = mutt_remove_duplicates (env->to); env->cc = mutt_remove_duplicates (env->cc); env->cc = mutt_remove_xrefs (env->to, env->cc); - + if (env->cc && !env->to) { env->to = env->cc; @@ -694,42 +694,42 @@ void mutt_add_to_reference_headers (ENVELOPE *env, ENVELOPE *curenv, LIST ***pp, if (pp) p = *pp; if (qq) q = *qq; - + if (!p) p = &env->references; if (!q) q = &env->in_reply_to; - + while (*p) p = &(*p)->next; while (*q) q = &(*q)->next; - + *p = mutt_make_references (curenv); - + if (curenv->message_id) { *q = mutt_new_list(); (*q)->data = safe_strdup (curenv->message_id); } - + if (pp) *pp = p; if (qq) *qq = q; - + #ifdef USE_NNTP if (option (OPTNEWSSEND) && option (OPTXCOMMENTTO) && curenv->from) env->x_comment_to = safe_strdup (mutt_get_name (curenv->from)); #endif } -static void +static void mutt_make_reference_headers (ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx) { env->references = NULL; env->in_reply_to = NULL; - + if (!curenv) { HEADER *h; LIST **p = NULL, **q = NULL; int i; - + for(i = 0; i < ctx->vcount; i++) { h = ctx->hdrs[ctx->v2r[i]]; @@ -868,7 +868,7 @@ generate_body (FILE *tempfp, /* stream for outgoing message */ BODY *last = msg->content; mutt_message (_("Preparing forwarded message...")); - + while (last && last->next) last = last->next; @@ -911,7 +911,7 @@ generate_body (FILE *tempfp, /* stream for outgoing message */ return -1; } /* if (WithCrypto && (flags & SENDKEY)) */ - else if ((WithCrypto & APPLICATION_PGP) && (flags & SENDKEY)) + else if ((WithCrypto & APPLICATION_PGP) && (flags & SENDKEY)) { BODY *tmp; @@ -933,7 +933,7 @@ void mutt_set_followup_to (ENVELOPE *e) ADDRESS *t = NULL; ADDRESS *from; - /* + /* * Only generate the Mail-Followup-To if the user has requested it, and * it hasn't already been set */ @@ -953,7 +953,7 @@ void mutt_set_followup_to (ENVELOPE *e) { if (mutt_is_list_cc (0, e->to, e->cc)) { - /* + /* * this message goes to known mailing lists, so create a proper * mail-followup-to header */ @@ -967,7 +967,7 @@ void mutt_set_followup_to (ENVELOPE *e) /* * If we are not subscribed to any of the lists in question, - * re-add ourselves to the mail-followup-to header. The + * re-add ourselves to the mail-followup-to header. The * mail-followup-to header generated is a no-op with group-reply, * but makes sure list-reply has the desired effect. */ @@ -980,20 +980,20 @@ void mutt_set_followup_to (ENVELOPE *e) from = rfc822_cpy_adr (e->from, 0); else from = mutt_default_from (); - + if (from) { /* Normally, this loop will not even be entered. */ for (t = from; t && t->next; t = t->next) ; - + t->next = e->mail_followup_to; /* t cannot be NULL at this point. */ e->mail_followup_to = from; } } - + e->mail_followup_to = mutt_remove_duplicates (e->mail_followup_to); - + } } @@ -1037,9 +1037,9 @@ ADDRESS *mutt_default_from (void) ADDRESS *adr; const char *fqdn = mutt_fqdn(1); - /* + /* * Note: We let $from override $realname here. Is this the right - * thing to do? + * thing to do? */ if (From) @@ -1055,19 +1055,19 @@ ADDRESS *mutt_default_from (void) adr = rfc822_new_address (); adr->mailbox = safe_strdup (NONULL(Username)); } - + return (adr); } static int send_message (HEADER *msg) -{ +{ char tempfile[_POSIX_PATH_MAX]; FILE *tempfp; int i; #ifdef USE_SMTP short old_write_bcc; #endif - + /* Write out the message in MIME form. */ mutt_mktemp (tempfile, sizeof (tempfile)); if ((tempfp = safe_fopen (tempfile, "w")) == NULL) @@ -1088,7 +1088,7 @@ static int send_message (HEADER *msg) if (old_write_bcc) set_option (OPTWRITEBCC); #endif - + fputc ('\n', tempfp); /* tie off the header. */ if ((mutt_write_mime_body (msg->content, tempfp) == -1)) @@ -1097,7 +1097,7 @@ static int send_message (HEADER *msg) unlink (tempfile); return (-1); } - + if (fclose (tempfp) != 0) { mutt_perror (tempfile); @@ -1120,7 +1120,7 @@ static int send_message (HEADER *msg) (msg->content->encoding == ENC8BIT)); #endif /* USE_SMTP */ - i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc, + i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc, msg->env->bcc, tempfile, (msg->content->encoding == ENC8BIT)); return (i); @@ -1146,7 +1146,7 @@ void mutt_encode_descriptions (BODY *b, short recurse) static void decode_descriptions (BODY *b) { BODY *t; - + for (t = b; t; t = t->next) { if (t->description) @@ -1162,7 +1162,7 @@ static void fix_end_of_file (const char *data) { FILE *fp; int c; - + if ((fp = safe_fopen (data, "a+")) == NULL) return; fseek (fp,-1,SEEK_END); @@ -1195,7 +1195,7 @@ int mutt_compose_to_sender (HEADER *hdr) int mutt_resend_message (FILE *fp, CONTEXT *ctx, HEADER *cur) { HEADER *msg = mutt_new_header (); - + if (mutt_prepare_template (fp, ctx, msg, cur, 1) < 0) { mutt_free_header (&msg); @@ -1306,7 +1306,7 @@ ci_send_message (int flags, /* send mode */ char *finalpath = NULL; int rv = -1; - + #ifdef USE_NNTP if (flags & SENDNEWS) set_option (OPTNEWSSEND); @@ -1326,8 +1326,8 @@ ci_send_message (int flags, /* send mode */ if(i == MUTT_YES) flags |= SENDPOSTPONED; } - - + + if (flags & SENDPOSTPONED) { if (WithCrypto & APPLICATION_PGP) @@ -1381,15 +1381,15 @@ ci_send_message (int flags, /* send mode */ } /* Parse and use an eventual list-post header */ - if ((flags & SENDLISTREPLY) - && cur && cur->env && cur->env->list_post) + if ((flags & SENDLISTREPLY) + && cur && cur->env && cur->env->list_post) { /* Use any list-post header as a template */ url_parse_mailto (msg->env, NULL, cur->env->list_post); /* We don't let them set the sender's address. */ rfc822_free_address (&msg->env->from); } - + if (! (flags & (SENDKEY | SENDPOSTPONED | SENDRESEND))) { /* When SENDDRAFTFILE is set, the caller has already @@ -1486,7 +1486,7 @@ ci_send_message (int flags, /* send mode */ /* Expand aliases and remove duplicates/crossrefs */ mutt_expand_aliases_env (msg->env); - + if (flags & SENDREPLY) mutt_fix_reply_recipients (msg->env); @@ -1528,7 +1528,7 @@ ci_send_message (int flags, /* send mode */ } /* change settings based upon recipients */ - + mutt_message_hook (NULL, msg, MUTT_SENDHOOK); /* @@ -1573,8 +1573,8 @@ ci_send_message (int flags, /* send mode */ && Editor && mutt_strcmp (Editor, "builtin") != 0) append_signature (tempfp); } - - /* + + /* * This hook is even called for postponed messages, and can, e.g., be * used for setting the editor, the sendmail path, or the * envelope sender. @@ -1642,7 +1642,7 @@ ci_send_message (int flags, /* send mode */ else mutt_perror (msg->content->filename); } - + /* If using format=flowed, perform space stuffing. Avoid stuffing when * recalling a postponed message where the stuffing was already * performed. If it has already been performed, the format=flowed @@ -1675,7 +1675,7 @@ ci_send_message (int flags, /* send mode */ } } - /* + /* * Set the message security unless: * 1) crypto support is not enabled (WithCrypto==0) * 2) pgp: header field was present during message editing with $edit_headers (msg->security != 0) @@ -1710,18 +1710,18 @@ ci_send_message (int flags, /* send mode */ if (msg->security || option (OPTCRYPTOPPORTUNISTICENCRYPT)) { - /* + /* * When replying / forwarding, use the original message's * crypto system. According to the documentation, * smime_is_default should be disregarded here. - * + * * Problem: At least with forwarding, this doesn't really * make much sense. Should we have an option to completely * disable individual mechanisms at run-time? */ if (cur) { - if ((WithCrypto & APPLICATION_PGP) && option (OPTCRYPTAUTOPGP) + if ((WithCrypto & APPLICATION_PGP) && option (OPTCRYPTAUTOPGP) && (cur->security & APPLICATION_PGP)) msg->security |= APPLICATION_PGP; else if ((WithCrypto & APPLICATION_SMIME) && option (OPTCRYPTAUTOSMIME) @@ -1731,11 +1731,11 @@ ci_send_message (int flags, /* send mode */ /* * No crypto mechanism selected? Use availability + smime_is_default - * for the decision. + * for the decision. */ if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP))) { - if ((WithCrypto & APPLICATION_SMIME) && option (OPTCRYPTAUTOSMIME) + if ((WithCrypto & APPLICATION_SMIME) && option (OPTCRYPTAUTOSMIME) && option (OPTSMIMEISDEFAULT)) msg->security |= APPLICATION_SMIME; else if ((WithCrypto & APPLICATION_PGP) && option (OPTCRYPTAUTOPGP)) @@ -1784,7 +1784,7 @@ ci_send_message (int flags, /* send mode */ } } - + mutt_update_encoding (msg->content); if (! (flags & (SENDMAILX | SENDBATCH))) @@ -1835,7 +1835,7 @@ main_loop: } /* - * make sure the message is written to the right part of a maildir + * make sure the message is written to the right part of a maildir * postponed folder. */ msg->read = 0; msg->old = 0; @@ -1884,10 +1884,10 @@ main_loop: FREE (&err); if (!(flags & SENDBATCH)) goto main_loop; - else + else goto cleanup; } - + if (!msg->env->subject && ! (flags & SENDBATCH) && (i = query_quadoption (OPT_SUBJECT, _("No subject, abort sending?"))) != MUTT_NO) { @@ -1927,45 +1927,45 @@ main_loop: if (msg->content->next) msg->content = mutt_make_multipart (msg->content); - /* + /* * Ok, we need to do it this way instead of handling all fcc stuff in * one place in order to avoid going to main_loop with encoded "env" * in case of error. Ugh. */ mutt_encode_descriptions (msg->content, 1); - + /* * Make sure that clear_content and free_clear_content are * properly initialized -- we may visit this particular place in * the code multiple times, including after a failed call to * mutt_protect(). */ - + clear_content = NULL; free_clear_content = 0; - + if (WithCrypto) { if (msg->security & (ENCRYPT | SIGN)) { /* save the decrypted attachments */ clear_content = msg->content; - + if ((crypt_get_keys (msg, &pgpkeylist, 0) == -1) || mutt_protect (msg, pgpkeylist) == -1) { msg->content = mutt_remove_multipart (msg->content); - + FREE (&pgpkeylist); - + decode_descriptions (msg->content); goto main_loop; } mutt_encode_descriptions (msg->content, 0); } - - /* + + /* * at this point, msg->content is one of the following three things: * - multipart/signed. In this case, clear_content is a child. * - multipart/encrypted. In this case, clear_content exists @@ -1973,9 +1973,9 @@ main_loop: * - application/pgp. In this case, clear_content exists independently. * - something else. In this case, it's the same as clear_content. */ - + /* This is ugly -- lack of "reporting back" from mutt_protect(). */ - + if (clear_content && (msg->content != clear_content) && (msg->content->parts != clear_content)) free_clear_content = 1; @@ -1990,13 +1990,13 @@ main_loop: mutt_expand_path (fcc, sizeof (fcc)); - + /* Don't save a copy when we are in batch-mode, and the FCC * folder is on an IMAP server: This would involve possibly lots - * of user interaction, which is not available in batch mode. - * + * of user interaction, which is not available in batch mode. + * * Note: A patch to fix the problems with the use of IMAP servers - * from non-curses mode is available from Brendan Cully. However, + * from non-curses mode is available from Brendan Cully. However, * I'd like to think a bit more about this before including it. */ @@ -2105,7 +2105,7 @@ full_fcc: { if (!WithCrypto) ; - else if ((msg->security & ENCRYPT) || + else if ((msg->security & ENCRYPT) || ((msg->security & SIGN) && msg->content->type == TYPEAPPLICATION)) { @@ -2115,7 +2115,7 @@ full_fcc: else if ((msg->security & SIGN) && msg->content->type == TYPEMULTIPART) { mutt_free_body (&msg->content->parts->next); /* destroy sig */ - msg->content = mutt_remove_multipart (msg->content); + msg->content = mutt_remove_multipart (msg->content); } msg->content = mutt_remove_multipart (msg->content); @@ -2145,7 +2145,7 @@ full_fcc: if (WithCrypto && (msg->security & ENCRYPT)) FREE (&pgpkeylist); - + if (WithCrypto && free_clear_content) mutt_free_body (&clear_content); @@ -2166,7 +2166,7 @@ full_fcc: rv = 0; - + cleanup: if (flags & SENDPOSTPONED) @@ -2182,7 +2182,7 @@ cleanup: SmimeDefaultKey = smime_default_key; } } - + safe_fclose (&tempfp); if (! (flags & SENDNOFREEHEADER)) mutt_free_header (&msg); diff --git a/signal.c b/signal.c index b471944c6..622527ad9 100644 --- a/signal.c +++ b/signal.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2012 Michael R. Elkins - * + * * 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" @@ -242,7 +242,7 @@ void mutt_unblock_signals_system (int catch) void mutt_allow_interrupt (int disposition) { struct sigaction sa; - + memset (&sa, 0, sizeof sa); sa.sa_handler = sighandler; #ifdef SA_RESTART diff --git a/smime.c b/smime.c index 6fa968811..42411c3d7 100644 --- a/smime.c +++ b/smime.c @@ -7,12 +7,12 @@ * 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. @@ -138,7 +138,7 @@ int smime_valid_passphrase (void) return 1; smime_void_passphrase(); - + if (mutt_get_password (_("Enter S/MIME passphrase:"), SmimePass, sizeof (SmimePass)) == 0) { SmimeExptime = time (NULL) + SmimeTimeout; @@ -172,7 +172,7 @@ static const char *_mutt_fmt_smime_command (char *dest, char fmt[16]; struct smime_command_context *cctx = (struct smime_command_context *) data; int optional = (flags & MUTT_FORMAT_OPTIONAL); - + switch (op) { case 'C': @@ -191,7 +191,7 @@ static const char *_mutt_fmt_smime_command (char *dest, snprintf (buf2, sizeof (buf2), "-CAfile %s", buf1); else snprintf (buf2, sizeof (buf2), "-CApath %s", buf1); - + snprintf (fmt, sizeof (fmt), "%%%ss", prefix); snprintf (dest, destlen, fmt, buf2); } @@ -199,7 +199,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'c': { /* certificate (list) */ if (!optional) { @@ -210,7 +210,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'i': { /* intermediate certificates */ if (!optional) { @@ -221,7 +221,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 's': { /* detached signature */ if (!optional) @@ -233,7 +233,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'k': { /* private key */ if (!optional) @@ -245,7 +245,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'a': { /* algorithm for encryption */ if (!optional) { @@ -256,7 +256,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'f': { /* file to process */ if (!optional) @@ -268,7 +268,7 @@ static const char *_mutt_fmt_smime_command (char *dest, optional = 0; break; } - + case 'd': { /* algorithm for the signature message digest */ if (!optional) { @@ -321,12 +321,12 @@ static pid_t smime_invoke (FILE **smimein, FILE **smimeout, FILE **smimeerr, { struct smime_command_context cctx; char cmd[HUGE_STRING]; - + memset (&cctx, 0, sizeof (cctx)); if (!format || !*format) return (pid_t) -1; - + cctx.fname = fname; cctx.sig_fname = sig_fname; cctx.key = key; @@ -334,7 +334,7 @@ static pid_t smime_invoke (FILE **smimein, FILE **smimeout, FILE **smimeerr, cctx.digestalg = digestalg; cctx.certificates = certificates; cctx.intermediates = intermediates; - + mutt_smime_command (cmd, sizeof (cmd), &cctx, format); return mutt_create_filter_fd (cmd, smimein, smimeout, smimeerr, @@ -779,7 +779,7 @@ smime_key_t *smime_ask_for_key(char *prompt, short abilities, short public) -/* +/* This sets the '*ToUse' variables for an upcoming decryption, where the required key is different from SmimeDefaultKey. */ @@ -804,7 +804,7 @@ void _smime_getkeys (char *mailbox) k = key->hash; /* the key used last time. */ - if (*SmimeKeyToUse && + if (*SmimeKeyToUse && !mutt_strcasecmp (k, SmimeKeyToUse + mutt_strlen (SmimeKeys)+1)) { smime_free_key (&key); @@ -812,9 +812,9 @@ void _smime_getkeys (char *mailbox) } else smime_void_passphrase (); - snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", + snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", NONULL(SmimeKeys), k); - + snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s", NONULL(SmimeCertificates), k); @@ -827,16 +827,16 @@ void _smime_getkeys (char *mailbox) if (*SmimeKeyToUse) { - if (!mutt_strcasecmp (SmimeDefaultKey, + if (!mutt_strcasecmp (SmimeDefaultKey, SmimeKeyToUse + mutt_strlen (SmimeKeys)+1)) return; smime_void_passphrase (); } - snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", + snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", NONULL (SmimeKeys), NONULL (SmimeDefaultKey)); - + snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s", NONULL (SmimeCertificates), NONULL (SmimeDefaultKey)); } @@ -848,9 +848,9 @@ void smime_getkeys (ENVELOPE *env) if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey && *SmimeDefaultKey) { - snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", + snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", NONULL (SmimeKeys), SmimeDefaultKey); - + snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s", NONULL(SmimeCertificates), SmimeDefaultKey); @@ -911,7 +911,7 @@ char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode) FREE (&keylist); return NULL; } - + keyID = key->hash; keylist_size += mutt_strlen (keyID) + 2; safe_realloc (&keylist, keylist_size); @@ -1080,7 +1080,7 @@ static char *smime_extract_certificate (char *infile) safe_fclose (&fperr); mutt_unlink (pk7out); return NULL; - + } @@ -1093,7 +1093,7 @@ static char *smime_extract_certificate (char *infile) mutt_perror (certfile); return NULL; } - + /* Step 2: Extract the certificates from a PKCS#7 structure. */ if ((thepid = smime_invoke (NULL, NULL, NULL, @@ -1158,7 +1158,7 @@ static char *smime_extract_signer_certificate (char *infile) mutt_perror (certfile); return NULL; } - + /* Extract signer's certificate */ if ((thepid = smime_invoke (NULL, NULL, NULL, @@ -1235,7 +1235,7 @@ void smime_invoke_import (char *infile, char *mailbox) if ((certfile = smime_extract_certificate(infile))) { mutt_endwin (NULL); - + if ((thepid = smime_invoke (&smimein, NULL, NULL, -1, fileno(fpout), fileno(fperr), certfile, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1249,7 +1249,7 @@ void smime_invoke_import (char *infile, char *mailbox) safe_fclose (&smimein); mutt_wait_filter (thepid); - + mutt_unlink (certfile); FREE (&certfile); } @@ -1294,13 +1294,13 @@ int smime_verify_sender(HEADER *h) if (h->env->from) { - h->env->from = mutt_expand_aliases (h->env->from); - mbox = h->env->from->mailbox; + h->env->from = mutt_expand_aliases (h->env->from); + mbox = h->env->from->mailbox; } else if (h->env->sender) { - h->env->sender = mutt_expand_aliases (h->env->sender); - mbox = h->env->sender->mailbox; + h->env->sender = mutt_expand_aliases (h->env->sender); + mbox = h->env->sender->mailbox; } if (mbox) @@ -1318,10 +1318,10 @@ int smime_verify_sender(HEADER *h) mutt_unlink(certfile); FREE (&certfile); } - else + else mutt_any_key_to_continue(_("no certfile")); } - else + else mutt_any_key_to_continue(_("no mbox")); mutt_unlink(tempfname); @@ -1357,7 +1357,7 @@ pid_t smime_invoke_encrypt (FILE **smimein, FILE **smimeout, FILE **smimeerr, static pid_t smime_invoke_sign (FILE **smimein, FILE **smimeout, FILE **smimeerr, - int smimeinfd, int smimeoutfd, int smimeerrfd, + int smimeinfd, int smimeoutfd, int smimeerrfd, const char *fname) { return smime_invoke (smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, @@ -1379,7 +1379,7 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) BODY *t; int err = 0, empty; pid_t thepid; - + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w+")) == NULL) { @@ -1396,7 +1396,7 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) return NULL; } mutt_unlink (smimeerrfile); - + mutt_mktemp (smimeinfile, sizeof (smimeinfile)); if ((fptmp = safe_fopen (smimeinfile, "w+")) == NULL) { @@ -1440,16 +1440,16 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) } safe_fclose (&smimein); - + mutt_wait_filter (thepid); mutt_unlink (smimeinfile); mutt_unlink (certfile); - + fflush (fpout); rewind (fpout); empty = (fgetc (fpout) == EOF); safe_fclose (&fpout); - + fflush (smimeerr); rewind (smimeerr); while (fgets (buf, sizeof (buf) - 1, smimeerr) != NULL) @@ -1484,7 +1484,7 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) t->unlink = 1; /*delete after sending the message */ t->parts=0; t->next=0; - + return (t); } @@ -1554,20 +1554,20 @@ BODY *smime_sign_message (BODY *a ) mutt_unlink (filetosign); return NULL; } - + mutt_write_mime_header (a, sfp); fputc ('\n', sfp); mutt_write_mime_body (a, sfp); safe_fclose (&sfp); - - snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", + + snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", NONULL(SmimeKeys), SmimeDefaultKey); snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s", NONULL(SmimeCertificates), SmimeDefaultKey); - + default_key = smime_get_key_by_hash (SmimeDefaultKey, 1); if ((! default_key) || (! mutt_strcmp ("?", default_key->issuer))) @@ -1579,7 +1579,7 @@ BODY *smime_sign_message (BODY *a ) NONULL(SmimeCertificates), intermediates); smime_free_key (&default_key); - + if ((thepid = smime_invoke_sign (&smimein, NULL, &smimeerr, @@ -1594,7 +1594,7 @@ BODY *smime_sign_message (BODY *a ) fputs (SmimePass, smimein); fputc ('\n', smimein); safe_fclose (&smimein); - + mutt_wait_filter (thepid); @@ -1616,7 +1616,7 @@ BODY *smime_sign_message (BODY *a ) safe_fclose (&smimeout); mutt_unlink (filetosign); - + if (err) mutt_any_key_to_continue (NULL); @@ -1678,7 +1678,7 @@ BODY *smime_sign_message (BODY *a ) static pid_t smime_invoke_verify (FILE **smimein, FILE **smimeout, FILE **smimeerr, - int smimeinfd, int smimeoutfd, int smimeerrfd, + int smimeinfd, int smimeoutfd, int smimeerrfd, const char *fname, const char *sig_fname, int opaque) { return smime_invoke (smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, @@ -1689,7 +1689,7 @@ pid_t smime_invoke_verify (FILE **smimein, FILE **smimeout, FILE **smimeerr, static pid_t smime_invoke_decrypt (FILE **smimein, FILE **smimeout, FILE **smimeerr, - int smimeinfd, int smimeoutfd, int smimeerrfd, + int smimeinfd, int smimeoutfd, int smimeerrfd, const char *fname) { return smime_invoke (smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, @@ -1713,7 +1713,7 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) snprintf (signedfile, sizeof (signedfile), "%s.sig", tempfile); - + /* decode to a tempfile, saving the original destination */ fp = s->fpout; if ((s->fpout = safe_fopen (signedfile, "w")) == NULL) @@ -1746,10 +1746,10 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) /* restore the prefix */ s->prefix = savePrefix; - + sigbdy->type = origType; - + mutt_mktemp (smimeerrfile, sizeof (smimeerrfile)); if (!(smimeerr = safe_fopen (smimeerrfile, "w+"))) { @@ -1757,16 +1757,16 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) mutt_unlink (signedfile); return -1; } - + crypt_current_time (s, "OpenSSL"); - - if ((thepid = smime_invoke_verify (NULL, &smimeout, NULL, + + if ((thepid = smime_invoke_verify (NULL, &smimeout, NULL, -1, -1, fileno (smimeerr), tempfile, signedfile, 0)) != -1) { fflush (smimeout); safe_fclose (&smimeout); - + if (mutt_wait_filter (thepid)) badsig = -1; else @@ -1774,10 +1774,10 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) char *line = NULL; int lineno = 0; size_t linelen; - + fflush (smimeerr); rewind (smimeerr); - + line = mutt_read_line (line, &linelen, smimeerr, &lineno, 0); if (linelen && !ascii_strcasecmp (line, "verification successful")) badsig = 0; @@ -1785,24 +1785,24 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) FREE (&line); } } - + fflush (smimeerr); rewind (smimeerr); mutt_copy_stream (smimeerr, s->fpout); safe_fclose (&smimeerr); - + state_attach_puts (_("[-- End of OpenSSL output --]\n\n"), s); - + mutt_unlink (signedfile); mutt_unlink (smimeerrfile); sigbdy->length = tmplength; sigbdy->offset = tmpoffset; - + /* restore the original source stream */ safe_fclose (&s->fpin); s->fpin = fp; - + return badsig; } @@ -1839,7 +1839,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) mutt_perror (outfile); return NULL; } - + mutt_mktemp (errfile, sizeof (errfile)); if ((smimeerr = safe_fopen (errfile, "w+")) == NULL) { @@ -1849,7 +1849,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) } mutt_unlink (errfile); - + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((tmpfp = safe_fopen (tmpfname, "w+")) == NULL) { @@ -1890,7 +1890,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) return NULL; } - + if (type & ENCRYPT) { if (!smime_valid_passphrase ()) @@ -1900,25 +1900,25 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) } safe_fclose (&smimein); - + mutt_wait_filter (thepid); mutt_unlink (tmpfname); - + if (s->flags & MUTT_DISPLAY) { fflush (smimeerr); rewind (smimeerr); - + if ((c = fgetc (smimeerr)) != EOF) { ungetc (c, smimeerr); - + crypt_current_time (s, "OpenSSL"); mutt_copy_stream (smimeerr, s->fpout); state_attach_puts (_("[-- End of OpenSSL output --]\n\n"), s); } - + if (type & ENCRYPT) state_attach_puts (_("[-- The following data is S/MIME" " encrypted --]\n"), s); @@ -1930,7 +1930,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) { fflush (smimeout); rewind (smimeout); - + if (outFile) fpout = outFile; else { @@ -1954,14 +1954,14 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) fputs (buf, fpout); } fflush (fpout); - rewind (fpout); + rewind (fpout); if ((p = mutt_read_mime_header (fpout, 0)) != NULL) { fstat (fileno (fpout), &info); p->length = info.st_size - p->offset; - + mutt_parse_part (fpout, p); if (s->fpout) { @@ -1971,7 +1971,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) mutt_body_handler (p, s); s->fpin = tmpfp_buffer; } - + } safe_fclose (&smimeout); smimeout = NULL; @@ -1998,15 +1998,15 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) char *line = NULL; int lineno = 0; size_t linelen; - + rewind (smimeerr); - + line = mutt_read_line (line, &linelen, smimeerr, &lineno, 0); if (linelen && !ascii_strcasecmp (line, "verification successful")) m->goodsig = 1; FREE (&line); } - else + else { m->goodsig = p->goodsig; m->badsig = p->badsig; @@ -2037,7 +2037,7 @@ int smime_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) if (b->parts) return -1; - + memset (&s, 0, sizeof (s)); s.fpin = fpin; fseeko (s.fpin, b->offset, 0); @@ -2073,7 +2073,7 @@ int smime_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) rv = -1; goto bail; } - + (*cur)->goodsig = b->goodsig; (*cur)->badsig = b->badsig; @@ -2084,7 +2084,7 @@ bail: safe_fclose (&tmpfp); if (*fpout) rewind (*fpout); - + return rv; } @@ -2244,11 +2244,11 @@ int smime_send_menu (HEADER *msg, int *redraw) case 'a': /* sign (a)s */ - if ((key = smime_ask_for_key (_("Sign as: "), KEYFLAG_CANSIGN, 0))) + if ((key = smime_ask_for_key (_("Sign as: "), KEYFLAG_CANSIGN, 0))) { mutt_str_replace (&SmimeDefaultKey, key->hash); smime_free_key (&key); - + msg->security |= SIGN; /* probably need a different passphrase */ diff --git a/smime.h b/smime.h index 22f030283..e204c235b 100644 --- a/smime.h +++ b/smime.h @@ -6,12 +6,12 @@ * 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. diff --git a/smtp.c b/smtp.c index 45ac4a4ef..0a4b321bd 100644 --- a/smtp.c +++ b/smtp.c @@ -531,7 +531,7 @@ static int smtp_auth (CONNECTION* conn) mutt_debug (2, "smtp_authenticate: Trying method %s\n", method); r = smtp_auth_sasl (conn, method); - + if (r == SMTP_AUTH_FAIL && delim) { mutt_error (_("%s authentication failed, trying next method"), method); diff --git a/sort.c b/sort.c index 6418afbc2..60a3d787f 100644 --- a/sort.c +++ b/sort.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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" @@ -294,7 +294,7 @@ void mutt_sort_headers (CONTEXT *ctx, int init) HEADER *h; THREAD *thread, *top; sort_t *sortfunc; - + unset_option (OPTNEEDRESORT); if (!ctx) @@ -353,7 +353,7 @@ void mutt_sort_headers (CONTEXT *ctx, int init) mutt_sleep (1); return; } - else + else qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc); /* adjust the virtual message numbers */ diff --git a/sort.h b/sort.h index b2c35cfd4..dc1ba7f1d 100644 --- a/sort.h +++ b/sort.h @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000 Michael R. Elkins - * + * * 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. - */ + */ #define SORT_DATE 1 /* the date the mail was sent. */ #define SORT_SIZE 2 diff --git a/status.c b/status.c index ab852b7e1..bfc9d250c 100644 --- a/status.c +++ b/status.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2007 Michael R. Elkins - * + * * 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" @@ -63,7 +63,7 @@ static void _menu_status_line (char *buf, size_t buflen, size_t col, int cols, M * %S = current aux sorting method ($sort_aux) * %t = # of tagged messages [option] * %u = number of unread messages [option] - * %v = Mutt version + * %v = Mutt version * %V = currently active limit pattern [option] */ static const char * status_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, @@ -240,7 +240,7 @@ status_format_str (char *buf, size_t buflen, size_t col, int cols, char op, cons (Context->magic != MUTT_IMAP && Context->deleted)) ? 1 : 0); } - + if (!StChars || !StChars->len) buf[0] = 0; else if (i >= StChars->len) @@ -249,7 +249,7 @@ status_format_str (char *buf, size_t buflen, size_t col, int cols, char op, cons snprintf (buf, buflen, "%s", StChars->chars[i]); break; } - + case 's': snprintf (fmt, sizeof (fmt), "%%%ss", prefix); snprintf (buf, buflen, fmt, diff --git a/system.c b/system.c index 80b25a18a..4a3532b1b 100644 --- a/system.c +++ b/system.c @@ -1,20 +1,20 @@ /* * Copyright (C) 1996-2000,2013 Michael R. Elkins - * + * * 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" diff --git a/thread.c b/thread.c index 3d72c44c7..ce36adc5b 100644 --- a/thread.c +++ b/thread.c @@ -5,16 +5,16 @@ * 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" @@ -66,7 +66,7 @@ static int need_display_subject (CONTEXT *ctx, HEADER *hdr) break; } } - + /* if there is a parent-to-child subject change anywhere between us and our * closest displayed ancestor, display the subject */ for (tmp = tree->parent; tmp; tmp = tmp->parent) @@ -196,14 +196,14 @@ static void calculate_visibility (CONTEXT *ctx, int *max_depth) tree = tree->prev; } } - + /* now fix up for the OPTHIDETOP* options if necessary */ if (hide_top_limited || hide_top_missing) { tree = ctx->tree; FOREVER { - if (!tree->visible && tree->deep && tree->subtree_visible < 2 + if (!tree->visible && tree->deep && tree->subtree_visible < 2 && ((tree->message && hide_top_limited) || (!tree->message && hide_top_missing))) tree->deep = 0; if (!tree->deep && tree->child && tree->subtree_visible) @@ -354,7 +354,7 @@ static LIST *make_subject_list (THREAD *cur, time_t *dateptr) time_t thisdate; LIST *curlist, *oldlist, *newlist, *subjects = NULL; int rc = 0; - + FOREVER { while (!cur->message) @@ -410,14 +410,14 @@ static LIST *make_subject_list (THREAD *cur, time_t *dateptr) /* find the best possible match for a parent message based upon subject. * if there are multiple matches, the one which was sent the latest, but - * before the current message, is used. + * before the current message, is used. */ static THREAD *find_subject (CONTEXT *ctx, THREAD *cur) { struct hash_elem *ptr; THREAD *tmp, *last = NULL; LIST *subjects = NULL, *oldlist; - time_t date = 0; + time_t date = 0; subjects = make_subject_list (cur, &date); @@ -589,9 +589,9 @@ THREAD *mutt_sort_subthreads (THREAD *thread, int init) THREAD **array, *sort_key, *top, *tmp; HEADER *oldsort_key; int i, array_size, sort_top = 0; - + /* we put things into the array backwards to save some cycles, - * but we want to have to move less stuff around if we're + * but we want to have to move less stuff around if we're * resorting, so we sort backwards and then put them back * in reverse order so they're forwards */ @@ -753,14 +753,14 @@ void mutt_sort_threads (CONTEXT *ctx, int init) THREAD *thread, *new, *tmp, top; memset (&top, 0, sizeof (top)); LIST *ref = NULL; - + /* set Sort to the secondary method to support the set sort_aux=reverse-* * settings. The sorting functions just look at the value of * SORT_REVERSE */ oldsort = Sort; Sort = SortAux; - + if (!ctx->thread_hash) init = 1; @@ -911,13 +911,13 @@ void mutt_sort_threads (CONTEXT *ctx, int init) ref = cur->env->references; else ref = cur->env->references->next; - + using_refs = 2; } } else ref = ref->next; /* go on with references */ - + if (!ref) break; @@ -964,7 +964,7 @@ void mutt_sort_threads (CONTEXT *ctx, int init) /* restore the oldsort order. */ Sort = oldsort; - + /* Put the list into an array. */ linearize_tree (ctx); @@ -1053,7 +1053,7 @@ int _mutt_aside_thread (HEADER *hdr, short dir, short subthreads) if ((dir != 0) ^ ((Sort & SORT_REVERSE) != 0)) { do - { + { cur = cur->next; if (!cur) return (-1); @@ -1063,7 +1063,7 @@ int _mutt_aside_thread (HEADER *hdr, short dir, short subthreads) else { do - { + { cur = cur->prev; if (!cur) return (-1); @@ -1202,7 +1202,7 @@ int _mutt_traverse_thread (CONTEXT *ctx, HEADER *cur, int flag) else if (flag & MUTT_THREAD_NEXT_UNREAD) return (min_unread); } - + FOREVER { cur = thread->message; @@ -1231,7 +1231,7 @@ int _mutt_traverse_thread (CONTEXT *ctx, HEADER *cur, int flag) if (cur != roothdr) cur->virtual = -1; } - else + else { if (CHECK_LIMIT) cur->virtual = cur->msgno; @@ -1314,16 +1314,16 @@ int mutt_messages_in_thread (CONTEXT *ctx, HEADER *hdr, int flag) { while (!threads[i]->message) threads[i] = threads[i]->child; - } + } if (Sort & SORT_REVERSE) rc = threads[0]->message->msgno - (threads[1] ? threads[1]->message->msgno : -1); else rc = (threads[1] ? threads[1]->message->msgno : ctx->msgcount) - threads[0]->message->msgno; - + if (flag) rc += 1; - + return (rc); } @@ -1419,9 +1419,9 @@ static int link_threads (HEADER *parent, HEADER *child, CONTEXT *ctx) child->env->in_reply_to = mutt_new_list (); child->env->in_reply_to->data = safe_strdup (parent->env->message_id); - + mutt_set_flag (ctx, child, MUTT_TAG, 0); - + child->env->irt_changed = child->changed = 1; return 1; } diff --git a/url.c b/url.c index 2e2ee10d6..20358a66a 100644 --- a/url.c +++ b/url.c @@ -1,20 +1,20 @@ /* * Copyright (C) 2000-2002,2004 Thomas Roessler - * + * * 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. - */ + */ /* * A simple URL parser. diff --git a/url.h b/url.h index 8221a8277..417abf94e 100644 --- a/url.h +++ b/url.h @@ -33,7 +33,7 @@ typedef struct ciss_url char *host; unsigned short port; char *path; -} +} ciss_url_t; url_scheme_t url_check_scheme (const char *s); diff --git a/utf8.c b/utf8.c index 145e22b2d..d1d067704 100644 --- a/utf8.c +++ b/utf8.c @@ -13,7 +13,7 @@ int mutt_wctoutf8 (char *s, unsigned int c, size_t buflen) { - if (c < (1 << 7)) + if (c < (1 << 7)) { if (s && buflen >= 1) *s++ = c; -- 2.40.0