]> granicus.if.org Git - neomutt/commitdiff
fp prefix
authorRichard Russon <rich@flatcap.org>
Thu, 28 Feb 2019 16:35:39 +0000 (16:35 +0000)
committerRichard Russon <rich@flatcap.org>
Tue, 5 Mar 2019 01:28:09 +0000 (01:28 +0000)
58 files changed:
commands.c
compress.c
compress.h
conn/ssl_gnutls.c
copy.c
copy.h
edit.c
email/attach.c
email/attach.h
email/parse.c
email/parse.h
filter.c
filter.h
fp.sed [new file with mode: 0644]
handler.c
help.c
icommands.c
init.c
maildir/lib.h
maildir/mh.c
maildir/shared.c
main.c
mbox/mbox.c
mutt/charset.c
mutt/charset.h
mutt/file.c
mutt/file.h
mutt/history.c
mutt_attach.c
mutt_header.c
muttlib.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/crypt_gpgme.h
ncrypt/crypt_mod.h
ncrypt/cryptglue.c
ncrypt/ncrypt.h
ncrypt/pgp.c
ncrypt/pgp.h
ncrypt/pgpinvoke.c
ncrypt/pgpinvoke.h
ncrypt/pgpkey.c
ncrypt/pgpmicalg.c
ncrypt/smime.c
ncrypt/smime.h
nntp/newsrc.c
nntp/nntp.h
notmuch/mutt_notmuch.c
pager.c
pop/pop.c
postpone.c
recvattach.c
recvcmd.c
rfc3676.c
send.c
send.h
sendlib.c
sendlib.h

index 2b16bde27b325ff76a95ce53ed8ac04efa3dc5ea..fd1238cc3aa03b8ea3aaae298db5efbd12421fc1 100644 (file)
@@ -179,8 +179,6 @@ int mutt_display_message(struct Email *cur)
   bool builtin = false;
   CopyMessageFlags cmflags = MUTT_CM_DECODE | MUTT_CM_DISPLAY | MUTT_CM_CHARCONV;
   CopyHeaderFlags chflags;
-  FILE *fpout = NULL;
-  FILE *fpfilterout = NULL;
   pid_t filterpid = -1;
   int res;
 
@@ -227,8 +225,9 @@ int mutt_display_message(struct Email *cur)
   }
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  fpout = mutt_file_fopen(tempfile, "w");
-  if (!fpout)
+  FILE *fp_filter_out = NULL;
+  FILE *fp_out = mutt_file_fopen(tempfile, "w");
+  if (!fp_out)
   {
     mutt_error(_("Could not create temporary file"));
     return 0;
@@ -236,14 +235,14 @@ int mutt_display_message(struct Email *cur)
 
   if (C_DisplayFilter && *C_DisplayFilter)
   {
-    fpfilterout = fpout;
-    fpout = NULL;
-    filterpid = mutt_create_filter_fd(C_DisplayFilter, &fpout, NULL, NULL, -1,
-                                      fileno(fpfilterout), -1);
+    fp_filter_out = fp_out;
+    fp_out = NULL;
+    filterpid = mutt_create_filter_fd(C_DisplayFilter, &fp_out, NULL, NULL, -1,
+                                      fileno(fp_filter_out), -1);
     if (filterpid < 0)
     {
       mutt_error(_("Cannot create display filter"));
-      mutt_file_fclose(&fpfilterout);
+      mutt_file_fclose(&fp_filter_out);
       unlink(tempfile);
       return 0;
     }
@@ -260,8 +259,8 @@ int mutt_display_message(struct Email *cur)
     hfi.email = cur;
     mutt_make_string_info(buf, sizeof(buf), MuttIndexWindow->cols,
                           NONULL(C_PagerFormat), &hfi, 0);
-    fputs(buf, fpout);
-    fputs("\n\n", fpout);
+    fputs(buf, fp_out);
+    fputs("\n\n", fp_out);
   }
 
   chflags = (C_Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY;
@@ -269,24 +268,24 @@ int mutt_display_message(struct Email *cur)
   if (Context->mailbox->magic == MUTT_NOTMUCH)
     chflags |= CH_VIRTUAL;
 #endif
-  res = mutt_copy_message_ctx(fpout, Context->mailbox, cur, cmflags, chflags);
+  res = mutt_copy_message_ctx(fp_out, Context->mailbox, cur, cmflags, chflags);
 
-  if ((mutt_file_fclose(&fpout) != 0 && errno != EPIPE) || res < 0)
+  if ((mutt_file_fclose(&fp_out) != 0 && errno != EPIPE) || res < 0)
   {
     mutt_error(_("Could not copy message"));
-    if (fpfilterout)
+    if (fp_filter_out)
     {
       mutt_wait_filter(filterpid);
-      mutt_file_fclose(&fpfilterout);
+      mutt_file_fclose(&fp_filter_out);
     }
     mutt_file_unlink(tempfile);
     return 0;
   }
 
-  if (fpfilterout && mutt_wait_filter(filterpid) != 0)
+  if (fp_filter_out && mutt_wait_filter(filterpid) != 0)
     mutt_any_key_to_continue(NULL);
 
-  mutt_file_fclose(&fpfilterout); /* XXX - check result? */
+  mutt_file_fclose(&fp_filter_out); /* XXX - check result? */
 
   if (WithCrypto)
   {
@@ -546,7 +545,7 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
 
   int rc = 0;
   pid_t pid;
-  FILE *fpout = NULL;
+  FILE *fp_out = NULL;
 
   if (!STAILQ_NEXT(en, entries))
   {
@@ -562,7 +561,7 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
     }
     mutt_endwin();
 
-    pid = mutt_create_filter(cmd, &fpout, NULL, NULL);
+    pid = mutt_create_filter(cmd, &fp_out, NULL, NULL);
     if (pid < 0)
     {
       mutt_perror(_("Can't create filter process"));
@@ -570,8 +569,8 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
     }
 
     OptKeepQuiet = true;
-    pipe_msg(m, en->email, fpout, decode, print);
-    mutt_file_fclose(&fpout);
+    pipe_msg(m, en->email, fp_out, decode, print);
+    mutt_file_fclose(&fp_out);
     rc = mutt_wait_filter(pid);
     OptKeepQuiet = false;
   }
@@ -598,18 +597,18 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
       {
         mutt_message_hook(m, en->email, MUTT_MESSAGE_HOOK);
         mutt_endwin();
-        pid = mutt_create_filter(cmd, &fpout, NULL, NULL);
+        pid = mutt_create_filter(cmd, &fp_out, NULL, NULL);
         if (pid < 0)
         {
           mutt_perror(_("Can't create filter process"));
           return 1;
         }
         OptKeepQuiet = true;
-        pipe_msg(m, en->email, fpout, decode, print);
+        pipe_msg(m, en->email, fp_out, decode, print);
         /* add the message separator */
         if (sep)
-          fputs(sep, fpout);
-        mutt_file_fclose(&fpout);
+          fputs(sep, fp_out);
+        mutt_file_fclose(&fp_out);
         if (mutt_wait_filter(pid) != 0)
           rc = 1;
         OptKeepQuiet = false;
@@ -618,7 +617,7 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
     else
     {
       mutt_endwin();
-      pid = mutt_create_filter(cmd, &fpout, NULL, NULL);
+      pid = mutt_create_filter(cmd, &fp_out, NULL, NULL);
       if (pid < 0)
       {
         mutt_perror(_("Can't create filter process"));
@@ -628,12 +627,12 @@ static int pipe_message(struct Mailbox *m, struct EmailList *el, char *cmd,
       STAILQ_FOREACH(en, el, entries)
       {
         mutt_message_hook(m, en->email, MUTT_MESSAGE_HOOK);
-        pipe_msg(m, en->email, fpout, decode, print);
+        pipe_msg(m, en->email, fp_out, decode, print);
         /* add the message separator */
         if (sep)
-          fputs(sep, fpout);
+          fputs(sep, fp_out);
       }
-      mutt_file_fclose(&fpout);
+      mutt_file_fclose(&fp_out);
       if (mutt_wait_filter(pid) != 0)
         rc = 1;
       OptKeepQuiet = false;
index 95ab895d25790a17217d70cbc256a7404d51972e..10bfc25e68771a808bade6b849126b6f73c9c06a 100644 (file)
@@ -78,21 +78,21 @@ static bool lock_realpath(struct Mailbox *m, bool excl)
     return true;
 
   if (excl)
-    ci->lockfp = fopen(m->realpath, "a");
+    ci->fp_lock = fopen(m->realpath, "a");
   else
-    ci->lockfp = fopen(m->realpath, "r");
-  if (!ci->lockfp)
+    ci->fp_lock = fopen(m->realpath, "r");
+  if (!ci->fp_lock)
   {
     mutt_perror(m->realpath);
     return false;
   }
 
-  int r = mutt_file_lock(fileno(ci->lockfp), excl, true);
+  int r = mutt_file_lock(fileno(ci->fp_lock), excl, true);
   if (r == 0)
     ci->locked = true;
   else if (excl)
   {
-    mutt_file_fclose(&ci->lockfp);
+    mutt_file_fclose(&ci->fp_lock);
     m->readonly = true;
     return true;
   }
@@ -116,10 +116,10 @@ static void unlock_realpath(struct Mailbox *m)
   if (!ci->locked)
     return;
 
-  mutt_file_unlock(fileno(ci->lockfp));
+  mutt_file_unlock(fileno(ci->fp_lock));
 
   ci->locked = false;
-  mutt_file_fclose(&ci->lockfp);
+  mutt_file_fclose(&ci->fp_lock);
 }
 
 /**
index d5e0b9530a4e03465f5c12390389b22732530b9c..6af38aae3e9af248eeebaa84224cde46d49dbeb1 100644 (file)
@@ -42,7 +42,7 @@ struct CompressInfo
   long size;                     /**< size of the compressed file */
   const struct MxOps *child_ops; /**< callbacks of de-compressed file */
   bool locked;                   /**< if realpath is locked */
-  FILE *lockfp;                  /**< fp used for locking */
+  FILE *fp_lock;                 /**< fp used for locking */
 };
 
 bool mutt_comp_can_append(struct Mailbox *m);
index 0f4def5822368dd0d22f6a3458f7089cb5e2dbaa..e89aab53434e3ea1d030ad695d2f08bc62d42eb5 100644 (file)
@@ -252,7 +252,6 @@ static int tls_compare_certificates(const gnutls_datum_t *peercert)
 {
   gnutls_datum_t cert;
   unsigned char *ptr = NULL;
-  FILE *fd1 = NULL;
   gnutls_datum_t b64_data;
   unsigned char *b64_data_data = NULL;
   struct stat filestat;
@@ -265,14 +264,12 @@ static int tls_compare_certificates(const gnutls_datum_t *peercert)
   b64_data_data[b64_data.size - 1] = '\0';
   b64_data.data = b64_data_data;
 
-  fd1 = fopen(C_CertificateFile, "r");
-  if (!fd1)
-  {
+  FILE *fp = fopen(C_CertificateFile, "r");
+  if (!fp)
     return 0;
-  }
 
-  b64_data.size = fread(b64_data.data, 1, b64_data.size, fd1);
-  mutt_file_fclose(&fd1);
+  b64_data.size = fread(b64_data.data, 1, b64_data.size, fp);
+  mutt_file_fclose(&fp);
 
   do
   {
diff --git a/copy.c b/copy.c
index 0f074b028af46672c12972daa65f6a71edd13719..5be1bf594380f2dbfc6e12727a3334d537d8ef47 100644 (file)
--- a/copy.c
+++ b/copy.c
 #endif
 
 static int address_header_decode(char **h);
-static int copy_delete_attach(struct Body *b, FILE *fpin, FILE *fpout, char *date);
+static int copy_delete_attach(struct Body *b, FILE *fp_in, FILE *fp_out, char *date);
 
 /**
  * mutt_copy_hdr - Copy header from one file to another
- * @param in        FILE pointer to read from
- * @param out       FILE pointer to write to
+ * @param fp_in     FILE pointer to read from
+ * @param fp_out    FILE pointer to write to
  * @param off_start Offset to start from
  * @param off_end   Offset to finish at
  * @param chflags   Flags, see #CopyHeaderFlags
@@ -69,7 +69,7 @@ static int copy_delete_attach(struct Body *b, FILE *fpin, FILE *fpout, char *dat
  * avoid creating a Header structure in message_handler().  Also, this one will
  * wrap headers much more aggressively than the other one.
  */
-int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
+int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end,
                   CopyHeaderFlags chflags, const char *prefix)
 {
   bool from = false;
@@ -87,8 +87,8 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
   if (off_start < 0)
     return -1;
 
-  if (ftello(in) != off_start)
-    if (fseeko(in, off_start, SEEK_SET) < 0)
+  if (ftello(fp_in) != off_start)
+    if (fseeko(fp_in, off_start, SEEK_SET) < 0)
       return -1;
 
   buf[0] = '\n';
@@ -99,11 +99,11 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
     /* Without these flags to complicate things
      * we can do a more efficient line to line copying
      */
-    while (ftello(in) < off_end)
+    while (ftello(fp_in) < off_end)
     {
       nl = strchr(buf, '\n');
 
-      if (!fgets(buf, sizeof(buf), in))
+      if (!fgets(buf, sizeof(buf), fp_in))
         break;
 
       /* Is it the beginning of a header? */
@@ -146,7 +146,7 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
         ignore = false;
       }
 
-      if (!ignore && fputs(buf, out) == EOF)
+      if (!ignore && fputs(buf, fp_out) == EOF)
         return -1;
     }
     return 0;
@@ -175,12 +175,12 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
   headers = mutt_mem_calloc(hdr_count, sizeof(char *));
 
   /* Read all the headers into the array */
-  while (ftello(in) < off_end)
+  while (ftello(fp_in) < off_end)
   {
     nl = strchr(buf, '\n');
 
     /* Read a line */
-    if (!fgets(buf, sizeof(buf), in))
+    if (!fgets(buf, sizeof(buf), fp_in))
       break;
 
     /* Is it the beginning of a header? */
@@ -310,7 +310,7 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
         this_one_len += blen;
       }
     }
-  } /* while (ftello (in) < off_end) */
+  } /* while (ftello (fp_in) < off_end) */
 
   /* Do we have anything pending?  -- XXX, same code as in above in the loop. */
   if (this_one)
@@ -347,9 +347,9 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
 
       if (chflags & (CH_DECODE | CH_PREFIX))
       {
-        if (mutt_write_one_header(out, 0, headers[x], (chflags & CH_PREFIX) ? prefix : 0,
-                                  mutt_window_wrap_cols(MuttIndexWindow, C_Wrap),
-                                  chflags) == -1)
+        if (mutt_write_one_header(
+                fp_out, 0, headers[x], (chflags & CH_PREFIX) ? prefix : 0,
+                mutt_window_wrap_cols(MuttIndexWindow, C_Wrap), chflags) == -1)
         {
           error = true;
           break;
@@ -357,7 +357,7 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
       }
       else
       {
-        if (fputs(headers[x], out) == EOF)
+        if (fputs(headers[x], fp_out) == EOF)
         {
           error = true;
           break;
@@ -379,15 +379,15 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
 
 /**
  * mutt_copy_header - Copy Email header
- * @param in       FILE pointer to read from
+ * @param fp_in    FILE pointer to read from
  * @param e        Email
- * @param out      FILE pointer to write to
+ * @param fp_out   FILE pointer to write to
  * @param chflags  See #CopyHeaderFlags
  * @param prefix   Prefix for quoting headers (if #CH_PREFIX is set)
  * @retval  0 Success
  * @retval -1 Failure
  */
-int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
+int mutt_copy_header(FILE *fp_in, struct Email *e, FILE *fp_out,
                      CopyHeaderFlags chflags, const char *prefix)
 {
   char *temp_hdr = NULL;
@@ -400,69 +400,69 @@ int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
                ((e->env->changed & MUTT_ENV_CHANGED_SUBJECT) ? CH_UPDATE_SUBJECT : 0);
   }
 
-  if (mutt_copy_hdr(in, out, e->offset, e->content->offset, chflags, prefix) == -1)
+  if (mutt_copy_hdr(fp_in, fp_out, e->offset, e->content->offset, chflags, prefix) == -1)
     return -1;
 
   if (chflags & CH_TXTPLAIN)
   {
     char chsbuf[128];
     char buf[128];
-    fputs("MIME-Version: 1.0\n", out);
-    fputs("Content-Transfer-Encoding: 8bit\n", out);
-    fputs("Content-Type: text/plain; charset=", out);
+    fputs("MIME-Version: 1.0\n", fp_out);
+    fputs("Content-Transfer-Encoding: 8bit\n", fp_out);
+    fputs("Content-Type: text/plain; charset=", fp_out);
     mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf), C_Charset ? C_Charset : "us-ascii");
     mutt_addr_cat(buf, sizeof(buf), chsbuf, MimeSpecials);
-    fputs(buf, out);
-    fputc('\n', out);
+    fputs(buf, fp_out);
+    fputc('\n', fp_out);
   }
 
   if ((chflags & CH_UPDATE_IRT) && !STAILQ_EMPTY(&e->env->in_reply_to))
   {
-    fputs("In-Reply-To:", out);
+    fputs("In-Reply-To:", fp_out);
     struct ListNode *np = NULL;
     STAILQ_FOREACH(np, &e->env->in_reply_to, entries)
     {
-      fputc(' ', out);
-      fputs(np->data, out);
+      fputc(' ', fp_out);
+      fputs(np->data, fp_out);
     }
-    fputc('\n', out);
+    fputc('\n', fp_out);
   }
 
   if ((chflags & CH_UPDATE_REFS) && !STAILQ_EMPTY(&e->env->references))
   {
-    fputs("References:", out);
-    mutt_write_references(&e->env->references, out, 0);
-    fputc('\n', out);
+    fputs("References:", fp_out);
+    mutt_write_references(&e->env->references, fp_out, 0);
+    fputc('\n', fp_out);
   }
 
   if ((chflags & CH_UPDATE) && (chflags & CH_NOSTATUS) == 0)
   {
     if (e->old || e->read)
     {
-      fputs("Status: ", out);
+      fputs("Status: ", fp_out);
       if (e->read)
-        fputs("RO", out);
+        fputs("RO", fp_out);
       else if (e->old)
-        fputc('O', out);
-      fputc('\n', out);
+        fputc('O', fp_out);
+      fputc('\n', fp_out);
     }
 
     if (e->flagged || e->replied)
     {
-      fputs("X-Status: ", out);
+      fputs("X-Status: ", fp_out);
       if (e->replied)
-        fputc('A', out);
+        fputc('A', fp_out);
       if (e->flagged)
-        fputc('F', out);
-      fputc('\n', out);
+        fputc('F', fp_out);
+      fputc('\n', fp_out);
     }
   }
 
   if (chflags & CH_UPDATE_LEN && (chflags & CH_NOLEN) == 0)
   {
-    fprintf(out, "Content-Length: " OFF_T_FMT "\n", e->content->length);
+    fprintf(fp_out, "Content-Length: " OFF_T_FMT "\n", e->content->length);
     if (e->lines != 0 || e->content->length == 0)
-      fprintf(out, "Lines: %d\n", e->lines);
+      fprintf(fp_out, "Lines: %d\n", e->lines);
   }
 
 #ifdef USE_NOTMUCH
@@ -476,18 +476,18 @@ int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
       mutt_str_strfcpy(buf, folder, sizeof(buf));
       mutt_pretty_mailbox(buf, sizeof(buf));
 
-      fputs("Folder: ", out);
-      fputs(buf, out);
-      fputc('\n', out);
+      fputs("Folder: ", fp_out);
+      fputs(buf, fp_out);
+      fputc('\n', fp_out);
     }
   }
 #endif
   char *tags = driver_tags_get(&e->tags);
   if (tags && !(C_Weed && mutt_matches_ignore("tags")))
   {
-    fputs("Tags: ", out);
-    fputs(tags, out);
-    fputc('\n', out);
+    fputs("Tags: ", fp_out);
+    fputs(tags, fp_out);
+    fputc('\n', fp_out);
   }
   FREE(&tags);
 
@@ -501,8 +501,9 @@ int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
       temp_hdr = mutt_str_strdup(temp_hdr);
       rfc2047_encode(&temp_hdr, NULL, sizeof("X-Label:"), C_SendCharset);
     }
-    if (mutt_write_one_header(out, "X-Label", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
-                              mutt_window_wrap_cols(MuttIndexWindow, C_Wrap), chflags) == -1)
+    if (mutt_write_one_header(
+            fp_out, "X-Label", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
+            mutt_window_wrap_cols(MuttIndexWindow, C_Wrap), chflags) == -1)
     {
       return -1;
     }
@@ -520,8 +521,9 @@ int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
       temp_hdr = mutt_str_strdup(temp_hdr);
       rfc2047_encode(&temp_hdr, NULL, sizeof("Subject:"), C_SendCharset);
     }
-    if (mutt_write_one_header(out, "Subject", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
-                              mutt_window_wrap_cols(MuttIndexWindow, C_Wrap), chflags) == -1)
+    if (mutt_write_one_header(
+            fp_out, "Subject", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
+            mutt_window_wrap_cols(MuttIndexWindow, C_Wrap), chflags) == -1)
       return -1;
     if (!(chflags & CH_DECODE))
       FREE(&temp_hdr);
@@ -530,11 +532,11 @@ int mutt_copy_header(FILE *in, struct Email *e, FILE *out,
   if ((chflags & CH_NONEWLINE) == 0)
   {
     if (chflags & CH_PREFIX)
-      fputs(prefix, out);
-    fputc('\n', out); /* add header terminator */
+      fputs(prefix, fp_out);
+    fputc('\n', fp_out); /* add header terminator */
   }
 
-  if (ferror(out) || feof(out))
+  if (ferror(fp_out) || feof(fp_out))
     return -1;
 
   return 0;
@@ -581,15 +583,15 @@ static int count_delete_lines(FILE *fp, struct Body *b, LOFF_T *length, size_t d
 
 /**
  * mutt_copy_message_fp - make a copy of a message from a FILE pointer
- * @param fpout   Where to write output
- * @param fpin    Where to get input
+ * @param fp_out   Where to write output
+ * @param fp_in    Where to get input
  * @param e       Email being copied
  * @param cmflags Flags, see #CopyMessageFlags
  * @param chflags Flags, see #CopyHeaderFlags
  * @retval  0 Success
  * @retval -1 Failure
  */
-int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
+int mutt_copy_message_fp(FILE *fp_out, FILE *fp_in, struct Email *e,
                          CopyMessageFlags cmflags, CopyHeaderFlags chflags)
 {
   struct Body *body = e->content;
@@ -626,30 +628,30 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
       date[dlen - 1] = '\"';
 
       /* Count the number of lines and bytes to be deleted */
-      fseeko(fpin, body->offset, SEEK_SET);
-      new_lines = e->lines - count_delete_lines(fpin, body, &new_length, dlen);
+      fseeko(fp_in, body->offset, SEEK_SET);
+      new_lines = e->lines - count_delete_lines(fp_in, body, &new_length, dlen);
 
       /* Copy the headers */
-      if (mutt_copy_header(fpin, e, fpout, chflags | CH_NOLEN | CH_NONEWLINE, NULL))
+      if (mutt_copy_header(fp_in, e, fp_out, chflags | CH_NOLEN | CH_NONEWLINE, NULL))
         return -1;
-      fprintf(fpout, "Content-Length: " OFF_T_FMT "\n", new_length);
+      fprintf(fp_out, "Content-Length: " OFF_T_FMT "\n", new_length);
       if (new_lines <= 0)
         new_lines = 0;
       else
-        fprintf(fpout, "Lines: %d\n", new_lines);
+        fprintf(fp_out, "Lines: %d\n", new_lines);
 
-      putc('\n', fpout);
-      if (ferror(fpout) || feof(fpout))
+      putc('\n', fp_out);
+      if (ferror(fp_out) || feof(fp_out))
         return -1;
-      new_offset = ftello(fpout);
+      new_offset = ftello(fp_out);
 
       /* Copy the body */
-      if (fseeko(fpin, body->offset, SEEK_SET) < 0)
+      if (fseeko(fp_in, body->offset, SEEK_SET) < 0)
         return -1;
-      if (copy_delete_attach(body, fpin, fpout, date))
+      if (copy_delete_attach(body, fp_in, fp_out, date))
         return -1;
 
-      LOFF_T fail = ((ftello(fpout) - new_offset) - new_length);
+      LOFF_T fail = ((ftello(fp_out) - new_offset) - new_length);
       if (fail)
       {
         mutt_error(ngettext("The length calculation was wrong by %ld byte",
@@ -678,20 +680,21 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
       return 0;
     }
 
-    if (mutt_copy_header(fpin, e, fpout, chflags, (chflags & CH_PREFIX) ? prefix : NULL) == -1)
+    if (mutt_copy_header(fp_in, e, fp_out, chflags,
+                         (chflags & CH_PREFIX) ? prefix : NULL) == -1)
     {
       return -1;
     }
 
-    new_offset = ftello(fpout);
+    new_offset = ftello(fp_out);
   }
 
   if (cmflags & MUTT_CM_DECODE)
   {
     /* now make a text/plain version of the message */
     struct State s = { 0 };
-    s.fp_in = fpin;
-    s.fp_out = fpout;
+    s.fp_in = fp_in;
+    s.fp_out = fp_out;
     if (cmflags & MUTT_CM_PREFIX)
       s.prefix = prefix;
     if (cmflags & MUTT_CM_DISPLAY)
@@ -718,15 +721,15 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
     if (((WithCrypto & APPLICATION_PGP) != 0) && (cmflags & MUTT_CM_DECODE_PGP) &&
         (e->security & APPLICATION_PGP) && e->content->type == TYPE_MULTIPART)
     {
-      if (crypt_pgp_decrypt_mime(fpin, &fp, e->content, &cur))
+      if (crypt_pgp_decrypt_mime(fp_in, &fp, e->content, &cur))
         return -1;
-      fputs("MIME-Version: 1.0\n", fpout);
+      fputs("MIME-Version: 1.0\n", fp_out);
     }
 
     if (((WithCrypto & APPLICATION_SMIME) != 0) && (cmflags & MUTT_CM_DECODE_SMIME) &&
         (e->security & APPLICATION_SMIME) && e->content->type == TYPE_APPLICATION)
     {
-      if (crypt_smime_decrypt_mime(fpin, &fp, e->content, &cur))
+      if (crypt_smime_decrypt_mime(fp_in, &fp, e->content, &cur))
         return -1;
     }
 
@@ -736,12 +739,12 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
       return -1;
     }
 
-    mutt_write_mime_header(cur, fpout);
-    fputc('\n', fpout);
+    mutt_write_mime_header(cur, fp_out);
+    fputc('\n', fp_out);
 
     if (fseeko(fp, cur->offset, SEEK_SET) < 0)
       return -1;
-    if (mutt_file_copy_bytes(fp, fpout, cur->length) == -1)
+    if (mutt_file_copy_bytes(fp, fp_out, cur->length) == -1)
     {
       mutt_file_fclose(&fp);
       mutt_body_free(&cur);
@@ -752,25 +755,25 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
   }
   else
   {
-    if (fseeko(fpin, body->offset, SEEK_SET) < 0)
+    if (fseeko(fp_in, body->offset, SEEK_SET) < 0)
       return -1;
     if (cmflags & MUTT_CM_PREFIX)
     {
       int c;
       size_t bytes = body->length;
 
-      fputs(prefix, fpout);
+      fputs(prefix, fp_out);
 
-      while ((c = fgetc(fpin)) != EOF && bytes--)
+      while ((c = fgetc(fp_in)) != EOF && bytes--)
       {
-        fputc(c, fpout);
+        fputc(c, fp_out);
         if (c == '\n')
         {
-          fputs(prefix, fpout);
+          fputs(prefix, fp_out);
         }
       }
     }
-    else if (mutt_file_copy_bytes(fpin, fpout, body->length) == -1)
+    else if (mutt_file_copy_bytes(fp_in, fp_out, body->length) == -1)
       return -1;
   }
 
@@ -785,7 +788,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
 
 /**
  * mutt_copy_message_ctx - Copy a message from a Context
- * @param fpout   FILE pointer to write to
+ * @param fp_out   FILE pointer to write to
  * @param src     Source mailbox
  * @param e       Email
  * @param cmflags Flags, see #CopyMessageFlags
@@ -796,7 +799,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e,
  * should be made to return -1 on fatal errors, and 1 on non-fatal errors
  * like partial decode, where it is worth displaying as much as possible
  */
-int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e,
+int mutt_copy_message_ctx(FILE *fp_out, struct Mailbox *src, struct Email *e,
                           CopyMessageFlags cmflags, CopyHeaderFlags chflags)
 {
   struct Message *msg = mx_msg_open(src, e->msgno);
@@ -804,8 +807,8 @@ int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e,
     return -1;
   if (!e->content)
     return -1;
-  int r = mutt_copy_message_fp(fpout, msg->fp, e, cmflags, chflags);
-  if ((r == 0) && (ferror(fpout) || feof(fpout)))
+  int r = mutt_copy_message_fp(fp_out, msg->fp, e, cmflags, chflags);
+  if ((r == 0) && (ferror(fp_out) || feof(fp_out)))
   {
     mutt_debug(LL_DEBUG1, "failed to detect EOF!\n");
     r = -1;
@@ -817,7 +820,7 @@ int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e,
 /**
  * append_message - appends a copy of the given message to a mailbox
  * @param dest    destination mailbox
- * @param fpin    where to get input
+ * @param fp_in    where to get input
  * @param src     source mailbox
  * @param e       Email being copied
  * @param cmflags Flags, see #CopyMessageFlags
@@ -825,16 +828,16 @@ int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e,
  * @retval  0 Success
  * @retval -1 Error
  */
-static int append_message(struct Mailbox *dest, FILE *fpin, struct Mailbox *src,
+static int append_message(struct Mailbox *dest, FILE *fp_in, struct Mailbox *src,
                           struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags)
 {
   char buf[256];
   struct Message *msg = NULL;
   int r;
 
-  if (fseeko(fpin, e->offset, SEEK_SET) < 0)
+  if (fseeko(fp_in, e->offset, SEEK_SET) < 0)
     return -1;
-  if (!fgets(buf, sizeof(buf), fpin))
+  if (!fgets(buf, sizeof(buf), fp_in))
     return -1;
 
   msg = mx_msg_open_new(dest, e, is_from(buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM);
@@ -843,7 +846,7 @@ static int append_message(struct Mailbox *dest, FILE *fpin, struct Mailbox *src,
   if (dest->magic == MUTT_MBOX || dest->magic == MUTT_MMDF)
     chflags |= CH_FROM | CH_FORCE_FROM;
   chflags |= (dest->magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
-  r = mutt_copy_message_fp(msg->fp, fpin, e, cmflags, chflags);
+  r = mutt_copy_message_fp(msg->fp, fp_in, e, cmflags, chflags);
   if (mx_msg_commit(dest, msg) != 0)
     r = -1;
 
@@ -880,8 +883,8 @@ int mutt_append_message(struct Mailbox *dest, struct Mailbox *src, struct Email
 /**
  * copy_delete_attach - Copy a message, deleting marked attachments
  * @param b     Email Body
- * @param fpin  FILE pointer to read from
- * @param fpout FILE pointer to write to
+ * @param fp_in  FILE pointer to read from
+ * @param fp_out FILE pointer to write to
  * @param date  Date stamp
  * @retval  0 Success
  * @retval -1 Failure
@@ -890,7 +893,7 @@ int mutt_append_message(struct Mailbox *dest, struct Mailbox *src, struct Email
  * any attachments which are marked for deletion.
  * Nothing is changed in the original message -- this is left to the caller.
  */
-static int copy_delete_attach(struct Body *b, FILE *fpin, FILE *fpout, char *date)
+static int copy_delete_attach(struct Body *b, FILE *fp_in, FILE *fp_out, char *date)
 {
   struct Body *part = NULL;
 
@@ -899,37 +902,37 @@ static int copy_delete_attach(struct Body *b, FILE *fpin, FILE *fpout, char *dat
     if (part->deleted || part->parts)
     {
       /* Copy till start of this part */
-      if (mutt_file_copy_bytes(fpin, fpout, part->hdr_offset - ftello(fpin)))
+      if (mutt_file_copy_bytes(fp_in, fp_out, part->hdr_offset - ftello(fp_in)))
         return -1;
 
       if (part->deleted)
       {
         fprintf(
-            fpout,
+            fp_out,
             "Content-Type: message/external-body; access-type=x-mutt-deleted;\n"
             "\texpiration=%s; length=" OFF_T_FMT "\n"
             "\n",
             date + 5, part->length);
-        if (ferror(fpout))
+        if (ferror(fp_out))
           return -1;
 
         /* Copy the original mime headers */
-        if (mutt_file_copy_bytes(fpin, fpout, part->offset - ftello(fpin)))
+        if (mutt_file_copy_bytes(fp_in, fp_out, part->offset - ftello(fp_in)))
           return -1;
 
         /* Skip the deleted body */
-        fseeko(fpin, part->offset + part->length, SEEK_SET);
+        fseeko(fp_in, part->offset + part->length, SEEK_SET);
       }
       else
       {
-        if (copy_delete_attach(part, fpin, fpout, date))
+        if (copy_delete_attach(part, fp_in, fp_out, date))
           return -1;
       }
     }
   }
 
   /* Copy the last parts */
-  if (mutt_file_copy_bytes(fpin, fpout, b->offset + b->length - ftello(fpin)))
+  if (mutt_file_copy_bytes(fp_in, fp_out, b->offset + b->length - ftello(fp_in)))
     return -1;
 
   return 0;
diff --git a/copy.h b/copy.h
index 6e17950dfb5df9083ba5880f9b6e4697fba93625..7c81ac9714f3d286c87cfef93c514073c2af2b23 100644 (file)
--- a/copy.h
+++ b/copy.h
@@ -69,12 +69,12 @@ typedef uint32_t CopyHeaderFlags;   ///< Flags for mutt_copy_header(), e.g. #CH_
 #define CH_UPDATE_SUBJECT (1 << 20) ///< Update Subject: protected header update
 #define CH_VIRTUAL        (1 << 21) ///< Write virtual header lines too
 
-int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, CopyHeaderFlags chflags, const char *prefix);
+int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end, CopyHeaderFlags chflags, const char *prefix);
 
-int mutt_copy_header(FILE *in, struct Email *e, FILE *out, CopyHeaderFlags chflags, const char *prefix);
+int mutt_copy_header(FILE *fp_in, struct Email *e, FILE *fp_out, CopyHeaderFlags chflags, const char *prefix);
 
-int mutt_copy_message_fp(FILE *fpout, FILE *fpin,           struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags);
-int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags);
+int mutt_copy_message_fp(FILE *fp_out, FILE *fp_in,          struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags);
+int mutt_copy_message_ctx(FILE *fp_out, struct Mailbox *src, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags);
 
 int mutt_append_message(struct Mailbox *dest, struct Mailbox *src, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags);
 
diff --git a/edit.c b/edit.c
index ae4f27c049b56bf63e27b626bec50c312cbe71f7..2407e1bb5ae404f574268be671c6876fa8913e71 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -80,7 +80,7 @@ static char *EditorHelp2 =
 
 /**
  * be_snarf_data - Read data from a file into a buffer
- * @param[in]  f      File to read from
+ * @param[in]  fp     File to read from
  * @param[out] buf    Buffer allocated to save data
  * @param[out] bufmax Allocated size of buffer
  * @param[out] buflen Bytes of buffer used
@@ -89,7 +89,7 @@ static char *EditorHelp2 =
  * @param[in]  prefix If true, prefix the lines with the #C_IndentString
  * @retval ptr Pointer to allocated buffer
  */
-static char **be_snarf_data(FILE *f, char **buf, int *bufmax, int *buflen,
+static char **be_snarf_data(FILE *fp, char **buf, int *bufmax, int *buflen,
                             LOFF_T offset, int bytes, int prefix)
 {
   char tmp[8192];
@@ -105,10 +105,10 @@ static char **be_snarf_data(FILE *f, char **buf, int *bufmax, int *buflen,
     tmplen = sizeof(tmp) - tmplen;
   }
 
-  fseeko(f, offset, SEEK_SET);
+  fseeko(fp, offset, SEEK_SET);
   while (bytes > 0)
   {
-    if (!fgets(p, tmplen - 1, f))
+    if (!fgets(p, tmplen - 1, fp))
       break;
     bytes -= mutt_str_strlen(p);
     if (*bufmax == *buflen)
@@ -138,17 +138,17 @@ static char **be_snarf_file(const char *path, char **buf, int *max, int *len, bo
   char tmp[1024];
   struct stat sb;
 
-  FILE *f = fopen(path, "r");
-  if (f)
+  FILE *fp = fopen(path, "r");
+  if (fp)
   {
-    fstat(fileno(f), &sb);
-    buf = be_snarf_data(f, buf, max, len, 0, sb.st_size, 0);
+    fstat(fileno(fp), &sb);
+    buf = be_snarf_data(fp, buf, max, len, 0, sb.st_size, 0);
     if (verbose)
     {
       snprintf(tmp, sizeof(tmp), "\"%s\" %lu bytes\n", path, (unsigned long) sb.st_size);
       addstr(tmp);
     }
-    mutt_file_fclose(&f);
+    mutt_file_fclose(&fp);
   }
   else
   {
@@ -168,16 +168,16 @@ static char **be_snarf_file(const char *path, char **buf, int *max, int *len, bo
  */
 static int be_barf_file(const char *path, char **buf, int buflen)
 {
-  FILE *f = fopen(path, "w");
-  if (!f)
+  FILE *fp = fopen(path, "w");
+  if (!fp)
   {
     addstr(strerror(errno));
     addch('\n');
     return -1;
   }
   for (int i = 0; i < buflen; i++)
-    fputs(buf[i], f);
-  if (fclose(f) == 0)
+    fputs(buf[i], fp);
+  if (fclose(fp) == 0)
     return 0;
   printw("fclose: %s\n", strerror(errno));
   return -1;
index e2182d8d9355d10f9309665b3e94935e161aef60..20af007852f58da933dff47773bef416b30de9c8 100644 (file)
@@ -54,9 +54,9 @@ void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
 /**
  * mutt_actx_add_fp - Save a File handle to the Attachment Context
  * @param actx   Attachment context
- * @param new_fp File handle to save
+ * @param fp_new File handle to save
  */
-void mutt_actx_add_fp(struct AttachCtx *actx, FILE *new_fp)
+void mutt_actx_add_fp(struct AttachCtx *actx, FILE *fp_new)
 {
   if (actx->fp_len == actx->fp_max)
   {
@@ -66,7 +66,7 @@ void mutt_actx_add_fp(struct AttachCtx *actx, FILE *new_fp)
       actx->fp_idx[i] = NULL;
   }
 
-  actx->fp_idx[actx->fp_len++] = new_fp;
+  actx->fp_idx[actx->fp_len++] = fp_new;
 }
 
 /**
index daf869c8c8a69c0fb02e89742b0b69a49afafa90..9389c0cd7fe94d8548e7bfd54d5449dbbb7521aa 100644 (file)
@@ -49,7 +49,7 @@ struct AttachPtr
 struct AttachCtx
 {
   struct Email *email; /**< used by recvattach for updating */
-  FILE *root_fp;       /**< used by recvattach for updating */
+  FILE *fp_root;       /**< used by recvattach for updating */
 
   struct AttachPtr **idx;
   short idxlen;
@@ -69,7 +69,7 @@ struct AttachCtx
 
 void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach);
 void mutt_actx_add_body(struct AttachCtx *actx, struct Body *new_body);
-void mutt_actx_add_fp(struct AttachCtx *actx, FILE *new_fp);
+void mutt_actx_add_fp(struct AttachCtx *actx, FILE *fp_new);
 void mutt_actx_free(struct AttachCtx **pactx);
 void mutt_actx_free_entries(struct AttachCtx *actx);
 
index 2276e08275526ff158d503c861156ad5332a344e..5c115ecfd2afb09f69d23fe72c97342fdfe14d49 100644 (file)
@@ -931,7 +931,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line,
 
 /**
  * mutt_rfc822_read_line - Read a header line from a file
- * @param f       File to read from
+ * @param fp      File to read from
  * @param line    Buffer to store the result
  * @param linelen Length of buffer
  * @retval ptr Line read from file
@@ -940,7 +940,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line,
  * lines.  "line" must point to a dynamically allocated string; it is
  * increased if more space is required to fit the whole line.
  */
-char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
+char *mutt_rfc822_read_line(FILE *fp, char *line, size_t *linelen)
 {
   char *buf = line;
   int ch;
@@ -948,8 +948,8 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
 
   while (true)
   {
-    if (!fgets(buf, *linelen - offset, f) || /* end of file or */
-        (ISSPACE(*line) && !offset))         /* end of headers */
+    if (!fgets(buf, *linelen - offset, fp) || /* end of file or */
+        (ISSPACE(*line) && !offset))          /* end of headers */
     {
       *line = 0;
       return line;
@@ -970,17 +970,17 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
       }
 
       /* check to see if the next line is a continuation line */
-      ch = fgetc(f);
+      ch = fgetc(fp);
       if ((ch != ' ') && (ch != '\t'))
       {
-        ungetc(ch, f);
+        ungetc(ch, fp);
         return line; /* next line is a separate header field or EOH */
       }
 
       /* eat tabs and spaces from the beginning of the continuation line */
-      while (((ch = fgetc(f)) == ' ') || (ch == '\t'))
+      while (((ch = fgetc(fp)) == ' ') || (ch == '\t'))
         ;
-      ungetc(ch, f);
+      ungetc(ch, fp);
       *++buf = ' '; /* string is still terminated because we removed
                        at least one whitespace char above */
     }
@@ -1000,7 +1000,7 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
 
 /**
  * mutt_rfc822_read_header - parses an RFC822 header
- * @param f         Stream to read from
+ * @param fp        Stream to read from
  * @param e         Current Email (optional)
  * @param user_hdrs If set, store user headers
  *                  Used for recall-message and postpone modes
@@ -1011,7 +1011,7 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
  *
  * Caller should free the Envelope using mutt_env_free().
  */
-struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdrs, bool weed)
+struct Envelope *mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
 {
   struct Envelope *env = mutt_env_new();
   char *p = NULL;
@@ -1037,9 +1037,9 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdr
     }
   }
 
-  while ((loc = ftello(f)) != -1)
+  while ((loc = ftello(fp)) != -1)
   {
-    line = mutt_rfc822_read_line(f, line, &linelen);
+    line = mutt_rfc822_read_line(fp, line, &linelen);
     if (*line == '\0')
       break;
     p = strpbrk(line, ": \t");
@@ -1059,7 +1059,7 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdr
         continue;
       }
 
-      fseeko(f, loc, SEEK_SET);
+      fseeko(fp, loc, SEEK_SET);
       break; /* end of header */
     }
 
@@ -1118,7 +1118,7 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdr
   if (e)
   {
     e->content->hdr_offset = e->offset;
-    e->content->offset = ftello(f);
+    e->content->offset = ftello(fp);
 
     rfc2047_decode_envelope(env);
 
index 08e433ad2a0bcac2d89d09072aba650e48c64790..c24bf59f67b0e1a526ed9482eca4fc0dcd50bb60 100644 (file)
@@ -42,7 +42,7 @@ void             mutt_parse_part(FILE *fp, struct Body *b);
 struct Body *    mutt_read_mime_header(FILE *fp, bool digest);
 int              mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, char *p, bool user_hdrs, bool weed, bool do_2047);
 struct Body *    mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
-struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdrs, bool weed);
-char *           mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
+struct Envelope *mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed);
+char *           mutt_rfc822_read_line(FILE *fp, char *line, size_t *linelen);
 
 #endif /* MUTT_EMAIL_PARSE_H */
index 902ab96e5bc3625c83fbc5eca660db5a5a3d5a65..ea75b402e666b6fc6539300c20fe6f82a9d087fa 100644 (file)
--- a/filter.c
+++ b/filter.c
 
 /**
  * mutt_create_filter_fd - Run a command on a pipe (optionally connect stdin/stdout)
- * @param[in]  cmd   Command line to invoke using `sh -c`
- * @param[out] in    File stream pointing to stdin for the command process, can be NULL
- * @param[out] out   File stream pointing to stdout for the command process, can be NULL
- * @param[out] err   File stream pointing to stderr for the command process, can be NULL
- * @param[in]  fdin  If `in` is NULL and fdin is not -1 then fdin will be used as stdin for the command process
- * @param[in]  fdout If `out` is NULL and fdout is not -1 then fdout will be used as stdout for the command process
- * @param[in]  fderr If `error` is NULL and fderr is not -1 then fderr will be used as stderr for the command process
+ * @param[in]  cmd    Command line to invoke using `sh -c`
+ * @param[out] fp_in  File stream pointing to stdin for the command process, can be NULL
+ * @param[out] fp_out File stream pointing to stdout for the command process, can be NULL
+ * @param[out] fp_err File stream pointing to stderr for the command process, can be NULL
+ * @param[in]  fdin   If `in` is NULL and fdin is not -1 then fdin will be used as stdin for the command process
+ * @param[in]  fdout  If `out` is NULL and fdout is not -1 then fdout will be used as stdout for the command process
+ * @param[in]  fderr  If `error` is NULL and fderr is not -1 then fderr will be used as stderr for the command process
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
  *    mutt_create_filter_fd(commandline, NULL, NULL, NULL, -1, -1, -1);
  * @endcode
  *
- * Additionally, in, out, and err will point to FILE* streams representing the
- * processes stdin, stdout, and stderr.
+ * Additionally, fp_in, fp_out, and fp_err will point to FILE* streams
+ * representing the processes stdin, stdout, and stderr.
  */
-pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
-                            int fdin, int fdout, int fderr)
+pid_t mutt_create_filter_fd(const char *cmd, FILE **fp_in, FILE **fp_out,
+                            FILE **fp_err, int fdin, int fdout, int fderr)
 {
   int pin[2], pout[2], perr[2], pid;
 
-  if (in)
+  if (fp_in)
   {
-    *in = 0;
+    *fp_in = 0;
     if (pipe(pin) == -1)
       return -1;
   }
 
-  if (out)
+  if (fp_out)
   {
-    *out = 0;
+    *fp_out = 0;
     if (pipe(pout) == -1)
     {
-      if (in)
+      if (fp_in)
       {
         close(pin[0]);
         close(pin[1]);
@@ -87,17 +87,17 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
     }
   }
 
-  if (err)
+  if (fp_err)
   {
-    *err = 0;
+    *fp_err = 0;
     if (pipe(perr) == -1)
     {
-      if (in)
+      if (fp_in)
       {
         close(pin[0]);
         close(pin[1]);
       }
-      if (out)
+      if (fp_out)
       {
         close(pout[0]);
         close(pout[1]);
@@ -113,7 +113,7 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
   {
     mutt_sig_unblock_system(false);
 
-    if (in)
+    if (fp_in)
     {
       close(pin[1]);
       dup2(pin[0], 0);
@@ -125,7 +125,7 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
       close(fdin);
     }
 
-    if (out)
+    if (fp_out)
     {
       close(pout[0]);
       dup2(pout[1], 1);
@@ -137,7 +137,7 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
       close(fdout);
     }
 
-    if (err)
+    if (fp_err)
     {
       close(perr[0]);
       dup2(perr[1], 2);
@@ -163,19 +163,19 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
   {
     mutt_sig_unblock_system(true);
 
-    if (in)
+    if (fp_in)
     {
       close(pin[0]);
       close(pin[1]);
     }
 
-    if (out)
+    if (fp_out)
     {
       close(pout[0]);
       close(pout[1]);
     }
 
-    if (err)
+    if (fp_err)
     {
       close(perr[0]);
       close(perr[1]);
@@ -184,22 +184,22 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
     return -1;
   }
 
-  if (out)
+  if (fp_out)
   {
     close(pout[1]);
-    *out = fdopen(pout[0], "r");
+    *fp_out = fdopen(pout[0], "r");
   }
 
-  if (in)
+  if (fp_in)
   {
     close(pin[0]);
-    *in = fdopen(pin[1], "w");
+    *fp_in = fdopen(pin[1], "w");
   }
 
-  if (err)
+  if (fp_err)
   {
     close(perr[1]);
-    *err = fdopen(perr[0], "r");
+    *fp_err = fdopen(perr[0], "r");
   }
 
   return pid;
@@ -207,15 +207,15 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
 
 /**
  * mutt_create_filter - Set up filter program
- * @param[in]  s   Command string
- * @param[out] in  FILE pointer of stdin
- * @param[out] out FILE pointer of stdout
- * @param[out] err FILE pointer of stderr
+ * @param[in]  s      Command string
+ * @param[out] fp_in  FILE pointer of stdin
+ * @param[out] fp_out FILE pointer of stdout
+ * @param[out] fp_err FILE pointer of stderr
  * @retval num PID of filter
  */
-pid_t mutt_create_filter(const char *s, FILE **in, FILE **out, FILE **err)
+pid_t mutt_create_filter(const char *s, FILE **fp_in, FILE **fp_out, FILE **fp_err)
 {
-  return mutt_create_filter_fd(s, in, out, err, -1, -1, -1);
+  return mutt_create_filter_fd(s, fp_in, fp_out, fp_err, -1, -1, -1);
 }
 
 /**
index 983a721f74acc4269df344f5c44b15c96bd37277..5062422e1a7645546ac8cdbd68a32abe08b93993 100644 (file)
--- a/filter.h
+++ b/filter.h
@@ -24,9 +24,8 @@
 #include <stdio.h>
 #include <unistd.h>
 
-pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
-                            int fdin, int fdout, int fderr);
-pid_t mutt_create_filter(const char *s, FILE **in, FILE **out, FILE **err);
+pid_t mutt_create_filter_fd(const char *cmd, FILE **fp_in, FILE **fp_out, FILE **fp_err, int fdin, int fdout, int fderr);
+pid_t mutt_create_filter(const char *s, FILE **fp_in, FILE **fp_out, FILE **fp_err);
 int mutt_wait_filter(pid_t pid);
 int mutt_wait_interactive_filter (pid_t pid);
 
diff --git a/fp.sed b/fp.sed
new file mode 100644 (file)
index 0000000..f2571e6
--- /dev/null
+++ b/fp.sed
@@ -0,0 +1,43 @@
+s/\<attf\>/fp_att/g
+s/\<bfp\>/fp_body/g
+s/\<decoded_fp\>/fp_decoded/g
+s/\<devnull\>/fp_null/g
+s/\<err\>/fp_err/g
+s/\<fd1\>/fp/g
+s/\<file\>/fp_file/g
+s/\<filter\>/fp_filter/g
+s/\<fin\>/fp_in/g
+s/\<fout\>/fp_out/g
+s/\<fperr\>/fp_err/g
+s/\<fpfilterout\>/fp_filter_out/g
+s/\<fpin\>/fp_in/g
+s/\<fpout\>/fp_out/g
+s/\<fptmp\>/fp_tmp/g
+s/\<frandom\>/fp_random/g
+s/\<f\>/fp/g
+s/\<ifp\>/fp_in/g
+s/\<in\>/fp_in/g
+s/\<lockfp\>/fp_lock/g
+s/\<newsrc_fp\>/fp_newsrc/g
+s/\<new_fp\>/fp_new/g
+s/\<nfp\>/fp_new/g
+s/\<ofp\>/fp_old/g
+s/\<ofp\>/fp_out/g
+s/\<out\>/fp_out/g
+s/\<parent_fp\>/fp_parent/g
+s/\<pgperr\>/fp_pgp_err/g
+s/\<pgpin\>/fp_pgp_in/g
+s/\<pgpout\>/fp_pgp_out/g
+s/\<pgptmp\>/fp_pgp_tmp/g
+s/\<ret_fp\>/fp_ret/g
+s/\<root_fp\>/fp_root/g
+s/\<savefp\>/fp_save/g
+s/\<sfp\>/fp_signed/g
+s/\<smimeerr\>/fp_smime_err/g
+s/\<smimein\>/fp_smime_in/g
+s/\<smimeout\>/fp_smime_out/g
+s/\<tempfp\>/fp_tmp/g
+s/\<tfp\>/fp_tmp/g
+s/\<tmpfp2\>/fp_tmp2/g
+s/\<tmpfp\>/fp_tmp/g
+s/\<tmpfp_buffer\>/fp_tmp_buffer/g
index ba2c7956534e57c118ae96911f37cad79b6b02f6..cea5828e4873849d8f85302f6d27a91a66272a55 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -532,9 +532,9 @@ static int autoview_handler(struct Body *a, struct State *s)
   char cmd[STR_COMMAND];
   char tempfile[PATH_MAX] = "";
   char *fname = NULL;
-  FILE *fpin = NULL;
-  FILE *fpout = NULL;
-  FILE *fperr = NULL;
+  FILE *fp_in = NULL;
+  FILE *fp_out = NULL;
+  FILE *fp_err = NULL;
   int piped = false;
   pid_t pid;
   int rc = 0;
@@ -561,27 +561,27 @@ static int autoview_handler(struct Body *a, struct State *s)
       mutt_message(_("Invoking autoview command: %s"), cmd);
     }
 
-    fpin = mutt_file_fopen(tempfile, "w+");
-    if (!fpin)
+    fp_in = mutt_file_fopen(tempfile, "w+");
+    if (!fp_in)
     {
       mutt_perror("fopen");
       rfc1524_free_entry(&entry);
       return -1;
     }
 
-    mutt_file_copy_bytes(s->fp_in, fpin, a->length);
+    mutt_file_copy_bytes(s->fp_in, fp_in, a->length);
 
     if (!piped)
     {
-      mutt_file_fclose(&fpin);
-      pid = mutt_create_filter(cmd, NULL, &fpout, &fperr);
+      mutt_file_fclose(&fp_in);
+      pid = mutt_create_filter(cmd, NULL, &fp_out, &fp_err);
     }
     else
     {
       unlink(tempfile);
-      fflush(fpin);
-      rewind(fpin);
-      pid = mutt_create_filter_fd(cmd, NULL, &fpout, &fperr, fileno(fpin), -1, -1);
+      fflush(fp_in);
+      rewind(fp_in);
+      pid = mutt_create_filter_fd(cmd, NULL, &fp_out, &fp_err, fileno(fp_in), -1, -1);
     }
 
     if (pid < 0)
@@ -598,13 +598,13 @@ static int autoview_handler(struct Body *a, struct State *s)
 
     if (s->prefix)
     {
-      while (fgets(buf, sizeof(buf), fpout))
+      while (fgets(buf, sizeof(buf), fp_out))
       {
         state_puts(s->prefix, s);
         state_puts(buf, s);
       }
       /* check for data on stderr */
-      if (fgets(buf, sizeof(buf), fperr))
+      if (fgets(buf, sizeof(buf), fp_err))
       {
         if (s->flags & MUTT_DISPLAY)
         {
@@ -614,7 +614,7 @@ static int autoview_handler(struct Body *a, struct State *s)
 
         state_puts(s->prefix, s);
         state_puts(buf, s);
-        while (fgets(buf, sizeof(buf), fperr))
+        while (fgets(buf, sizeof(buf), fp_err))
         {
           state_puts(s->prefix, s);
           state_puts(buf, s);
@@ -623,9 +623,9 @@ static int autoview_handler(struct Body *a, struct State *s)
     }
     else
     {
-      mutt_file_copy_stream(fpout, s->fp_out);
+      mutt_file_copy_stream(fp_out, s->fp_out);
       /* Check for stderr messages */
-      if (fgets(buf, sizeof(buf), fperr))
+      if (fgets(buf, sizeof(buf), fp_err))
       {
         if (s->flags & MUTT_DISPLAY)
         {
@@ -634,17 +634,17 @@ static int autoview_handler(struct Body *a, struct State *s)
         }
 
         state_puts(buf, s);
-        mutt_file_copy_stream(fperr, s->fp_out);
+        mutt_file_copy_stream(fp_err, s->fp_out);
       }
     }
 
   bail:
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_err);
 
     mutt_wait_filter(pid);
     if (piped)
-      mutt_file_fclose(&fpin);
+      mutt_file_fclose(&fp_in);
     else
       mutt_file_unlink(tempfile);
 
diff --git a/help.c b/help.c
index bd846dbf5f0fbbc7af4e83621654c30b97cd7f1c..794e83e5619cacc77f0cd001fc5d30c7ab896eb4 100644 (file)
--- a/help.c
+++ b/help.c
@@ -134,14 +134,14 @@ char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping
 
 /**
  * print_macro - Print a macro string to a file
- * @param[in]  f        File to write to
+ * @param[in]  fp       File to write to
  * @param[in]  maxwidth Maximum width in screen columns
  * @param[out] macro    Macro string
  * @retval num Number of screen columns used
  *
  * The `macro` pointer is move past the string we've printed
  */
-static int print_macro(FILE *f, int maxwidth, const char **macro)
+static int print_macro(FILE *fp, int maxwidth, const char **macro)
 {
   int n = maxwidth;
   wchar_t wc;
@@ -173,7 +173,7 @@ static int print_macro(FILE *f, int maxwidth, const char **macro)
         if ((n1 = wcrtomb(buf, wc, &mbstate2)) != (size_t)(-1) &&
             (n2 = wcrtomb(buf + n1, 0, &mbstate2)) != (size_t)(-1))
         {
-          fputs(buf, f);
+          fputs(buf, fp);
         }
       }
     }
@@ -183,22 +183,22 @@ static int print_macro(FILE *f, int maxwidth, const char **macro)
         break;
       n -= 2;
       if (wc == '\033')
-        fprintf(f, "\\e");
+        fprintf(fp, "\\e");
       else if (wc == '\n')
-        fprintf(f, "\\n");
+        fprintf(fp, "\\n");
       else if (wc == '\r')
-        fprintf(f, "\\r");
+        fprintf(fp, "\\r");
       else if (wc == '\t')
-        fprintf(f, "\\t");
+        fprintf(fp, "\\t");
       else
-        fprintf(f, "^%c", (char) ((wc + '@') & 0x7f));
+        fprintf(fp, "^%c", (char) ((wc + '@') & 0x7f));
     }
     else
     {
       if (n < 1)
         break;
       n -= 1;
-      fprintf(f, "?");
+      fprintf(fp, "?");
     }
   }
   return maxwidth - n;
@@ -247,28 +247,28 @@ static int get_wrapped_width(const char *t, size_t wid)
 
 /**
  * pad - Write some padding to a file
- * @param f   File to write to
+ * @param fp  File to write to
  * @param col Current screen column
  * @param i   Screen column to pad until
  * @retval col Padding was added
  * @retval i   Content was already wider than col
  */
-static int pad(FILE *f, int col, int i)
+static int pad(FILE *fp, int col, int i)
 {
   if (col < i)
   {
     char fmt[32] = "";
     snprintf(fmt, sizeof(fmt), "%%-%ds", i - col);
-    fprintf(f, fmt, "");
+    fprintf(fp, fmt, "");
     return i;
   }
-  fputc(' ', f);
+  fputc(' ', fp);
   return col + 1;
 }
 
 /**
  * format_line - Write a formatted line to a file
- * @param f       File to write to
+ * @param fp      File to write to
  * @param ismacro Layout mode, see below
  * @param t1      Text part 1
  * @param t2      Text part 2
@@ -281,13 +281,13 @@ static int pad(FILE *f, int col, int i)
  * *  0 : Non-macro
  * * -1 : Macro with no description
  */
-static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, const char *t3)
+static void format_line(FILE *fp, int ismacro, const char *t1, const char *t2, const char *t3)
 {
   int col;
   int col_b;
   bool split;
 
-  fputs(t1, f);
+  fputs(t1, fp);
 
   /* don't try to press string into one line with less than 40 characters. */
   split = (MuttIndexWindow->cols < 40);
@@ -295,40 +295,40 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co
   {
     col = 0;
     col_b = 1024;
-    fputc('\n', f);
+    fputc('\n', fp);
   }
   else
   {
     const int col_a = MuttIndexWindow->cols > 83 ? (MuttIndexWindow->cols - 32) >> 2 : 12;
     col_b = MuttIndexWindow->cols > 49 ? (MuttIndexWindow->cols - 10) >> 1 : 19;
-    col = pad(f, mutt_strwidth(t1), col_a);
+    col = pad(fp, mutt_strwidth(t1), col_a);
   }
 
   if (ismacro > 0)
   {
     if (mutt_str_strcmp(C_Pager, "builtin") == 0)
-      fputs("_\010", f);
-    fputs("M ", f);
+      fputs("_\010", fp);
+    fputs("M ", fp);
     col += 2;
 
     if (!split)
     {
-      col += print_macro(f, col_b - col - 4, &t2);
+      col += print_macro(fp, col_b - col - 4, &t2);
       if (mutt_strwidth(t2) > col_b - col)
         t2 = "...";
     }
   }
 
-  col += print_macro(f, col_b - col - 1, &t2);
+  col += print_macro(fp, col_b - col - 1, &t2);
   if (split)
-    fputc('\n', f);
+    fputc('\n', fp);
   else
-    col = pad(f, col, col_b);
+    col = pad(fp, col, col_b);
 
   if (split)
   {
-    print_macro(f, 1024, &t3);
-    fputc('\n', f);
+    print_macro(fp, 1024, &t3);
+    fputc('\n', fp);
   }
   else
   {
@@ -342,13 +342,13 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co
         n = get_wrapped_width(t3, n);
       }
 
-      n = print_macro(f, n, &t3);
+      n = print_macro(fp, n, &t3);
 
       if (*t3)
       {
         if (mutt_str_strcmp(C_Pager, "builtin") != 0)
         {
-          fputc('\n', f);
+          fputc('\n', fp);
           n = 0;
         }
         else
@@ -357,20 +357,20 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co
           if (C_Markers)
             n++;
         }
-        col = pad(f, n, col_b);
+        col = pad(fp, n, col_b);
       }
     }
   }
 
-  fputc('\n', f);
+  fputc('\n', fp);
 }
 
 /**
  * dump_menu - Write all the key bindings to a file
- * @param f    File to write to
+ * @param fp   File to write to
  * @param menu Current Menu
  */
-static void dump_menu(FILE *f, int menu)
+static void dump_menu(FILE *fp, int menu)
 {
   struct Keymap *map = NULL;
   const struct Binding *b = NULL;
@@ -386,14 +386,14 @@ static void dump_menu(FILE *f, int menu)
       if (map->op == OP_MACRO)
       {
         if (!map->desc)
-          format_line(f, -1, buf, "macro", map->macro);
+          format_line(fp, -1, buf, "macro", map->macro);
         else
-          format_line(f, 1, buf, map->macro, map->desc);
+          format_line(fp, 1, buf, map->macro, map->desc);
       }
       else
       {
         b = help_lookup_function(map->op, menu);
-        format_line(f, 0, buf, b ? b->name : "UNKNOWN",
+        format_line(fp, 0, buf, b ? b->name : "UNKNOWN",
                     b ? _(HelpStrings[b->op]) : _("ERROR: please report this bug"));
       }
     }
@@ -416,18 +416,18 @@ static bool is_bound(struct Keymap *map, int op)
 
 /**
  * dump_unbound - Write out all the operations with no key bindings
- * @param f     File to write to
+ * @param fp    File to write to
  * @param funcs All the bindings for the current menu
  * @param map   First key map to consider
  * @param aux   Second key map to consider
  */
-static void dump_unbound(FILE *f, const struct Binding *funcs,
+static void dump_unbound(FILE *fp, const struct Binding *funcs,
                          struct Keymap *map, struct Keymap *aux)
 {
   for (int i = 0; funcs[i].name; i++)
   {
     if (!is_bound(map, funcs[i].op) && (!aux || !is_bound(aux, funcs[i].op)))
-      format_line(f, 0, funcs[i].name, "", _(HelpStrings[funcs[i].op]));
+      format_line(fp, 0, funcs[i].name, "", _(HelpStrings[funcs[i].op]));
   }
 }
 
@@ -439,7 +439,7 @@ void mutt_help(int menu)
 {
   char t[PATH_MAX];
   char buf[128];
-  FILE *f = NULL;
+  FILE *fp = NULL;
 
   mutt_mktemp(t, sizeof(t));
 
@@ -450,27 +450,27 @@ void mutt_help(int menu)
 
   do
   {
-    f = mutt_file_fopen(t, "w");
-    if (!f)
+    fp = mutt_file_fopen(t, "w");
+    if (!fp)
     {
       mutt_perror(t);
       return;
     }
 
-    dump_menu(f, menu);
+    dump_menu(fp, menu);
     if (menu != MENU_EDITOR && menu != MENU_PAGER)
     {
-      fprintf(f, "\n%s\n\n", _("Generic bindings:"));
-      dump_menu(f, MENU_GENERIC);
+      fprintf(fp, "\n%s\n\n", _("Generic bindings:"));
+      dump_menu(fp, MENU_GENERIC);
     }
 
-    fprintf(f, "\n%s\n\n", _("Unbound functions:"));
+    fprintf(fp, "\n%s\n\n", _("Unbound functions:"));
     if (funcs)
-      dump_unbound(f, funcs, Keymaps[menu], NULL);
+      dump_unbound(fp, funcs, Keymaps[menu], NULL);
     if (menu != MENU_PAGER)
-      dump_unbound(f, OpGeneric, Keymaps[MENU_GENERIC], Keymaps[menu]);
+      dump_unbound(fp, OpGeneric, Keymaps[MENU_GENERIC], Keymaps[menu]);
 
-    mutt_file_fclose(&f);
+    mutt_file_fclose(&fp);
 
     snprintf(buf, sizeof(buf), _("Help for %s"), desc);
   } while (mutt_do_pager(buf, t, MUTT_PAGER_RETWINCH | MUTT_PAGER_MARKER | MUTT_PAGER_NSKIP | MUTT_PAGER_NOWRAP,
index 26481f767fe1ffe701faecfdcad4a43b74651cb2..93e75c584e9f1c38a2135d50d78a14e34d01e229 100644 (file)
@@ -228,7 +228,7 @@ static void dump_all_menus(struct Buffer *buf, bool bind)
 static enum CommandResult icmd_bind(struct Buffer *buf, struct Buffer *s,
                                     unsigned long data, struct Buffer *err)
 {
-  FILE *fpout = NULL;
+  FILE *fp_out = NULL;
   char tempfile[PATH_MAX];
   bool dump_all = false, bind = (data == 0);
 
@@ -272,16 +272,16 @@ static enum CommandResult icmd_bind(struct Buffer *buf, struct Buffer *s,
   }
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  fpout = mutt_file_fopen(tempfile, "w");
-  if (!fpout)
+  fp_out = mutt_file_fopen(tempfile, "w");
+  if (!fp_out)
   {
     mutt_buffer_printf(err, _("Could not create temporary file %s"), tempfile);
     mutt_buffer_free(&filebuf);
     return MUTT_CMD_ERROR;
   }
-  fputs(filebuf->data, fpout);
+  fputs(filebuf->data, fp_out);
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
   mutt_buffer_free(&filebuf);
 
   struct Pager info = { 0 };
@@ -303,8 +303,8 @@ static enum CommandResult icmd_set(struct Buffer *buf, struct Buffer *s,
   char tempfile[PATH_MAX];
   mutt_mktemp(tempfile, sizeof(tempfile));
 
-  FILE *fpout = mutt_file_fopen(tempfile, "w");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfile, "w");
+  if (!fp_out)
   {
     mutt_buffer_addstr(err, _("Could not create temporary file"));
     return MUTT_CMD_ERROR;
@@ -312,19 +312,19 @@ static enum CommandResult icmd_set(struct Buffer *buf, struct Buffer *s,
 
   if (mutt_str_strcmp(s->data, "set all") == 0)
   {
-    dump_config(Config, CS_DUMP_STYLE_NEO, 0, fpout);
+    dump_config(Config, CS_DUMP_STYLE_NEO, 0, fp_out);
   }
   else if (mutt_str_strcmp(s->data, "set") == 0)
   {
-    dump_config(Config, CS_DUMP_STYLE_NEO, CS_DUMP_ONLY_CHANGED, fpout);
+    dump_config(Config, CS_DUMP_STYLE_NEO, CS_DUMP_ONLY_CHANGED, fp_out);
   }
   else
   {
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_out);
     return MUTT_CMD_ERROR;
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
 
   struct Pager info = { 0 };
   if (mutt_pager("set", tempfile, 0, &info) == -1)
@@ -345,15 +345,15 @@ static enum CommandResult icmd_version(struct Buffer *buf, struct Buffer *s,
   char tempfile[PATH_MAX];
   mutt_mktemp(tempfile, sizeof(tempfile));
 
-  FILE *fpout = mutt_file_fopen(tempfile, "w");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfile, "w");
+  if (!fp_out)
   {
     mutt_buffer_addstr(err, _("Could not create temporary file"));
     return MUTT_CMD_ERROR;
   }
 
-  print_version(fpout);
-  mutt_file_fclose(&fpout);
+  print_version(fp_out);
+  mutt_file_fclose(&fp_out);
 
   struct Pager info = { 0 };
   if (mutt_pager("version", tempfile, 0, &info) == -1)
diff --git a/init.c b/init.c
index 9c91a2091e107dad0a160f3e133209533d29c985..aea5087a90e7786ed3f45ae74594c43abeacfdd0 100644 (file)
--- a/init.c
+++ b/init.c
@@ -360,13 +360,13 @@ static char *getmailname(void)
 
   for (size_t i = 0; i < mutt_array_size(mn_files); i++)
   {
-    FILE *f = mutt_file_fopen(mn_files[i], "r");
-    if (!f)
+    FILE *fp = mutt_file_fopen(mn_files[i], "r");
+    if (!fp)
       continue;
 
     size_t len = 0;
-    mailname = mutt_file_read_line(NULL, &len, f, NULL, 0);
-    mutt_file_fclose(&f);
+    mailname = mutt_file_read_line(NULL, &len, fp, NULL, 0);
+    mutt_file_fclose(&fp);
     if (mailname && *mailname)
       break;
 
@@ -750,7 +750,6 @@ static void remove_from_stailq(struct ListHead *head, const char *str)
  */
 static int source_rc(const char *rcfile_path, struct Buffer *err)
 {
-  FILE *f = NULL;
   int line = 0, rc = 0, warnings = 0;
   enum CommandResult line_rc;
   struct Buffer token;
@@ -800,15 +799,15 @@ static int source_rc(const char *rcfile_path, struct Buffer *err)
 
   mutt_debug(LL_DEBUG2, "Reading configuration file '%s'.\n", rcfile);
 
-  f = mutt_open_read(rcfile, &pid);
-  if (!f)
+  FILE *fp = mutt_open_read(rcfile, &pid);
+  if (!fp)
   {
     mutt_buffer_printf(err, "%s: %s", rcfile, strerror(errno));
     return -1;
   }
 
   mutt_buffer_init(&token);
-  while ((linebuf = mutt_file_read_line(linebuf, &buflen, f, &line, MUTT_CONT)))
+  while ((linebuf = mutt_file_read_line(linebuf, &buflen, fp, &line, MUTT_CONT)))
   {
     const int conv = C_ConfigCharset && (*C_ConfigCharset) && C_Charset;
     if (conv)
@@ -852,7 +851,7 @@ static int source_rc(const char *rcfile_path, struct Buffer *err)
   }
   FREE(&token.data);
   FREE(&linebuf);
-  mutt_file_fclose(&f);
+  mutt_file_fclose(&fp);
   if (pid != -1)
     mutt_wait_filter(pid);
   if (rc)
index 2a6158baadb8b2185f1d729e4783283cb173b2cf..2bde74725565db8dde8bd8a79e40ea711c08c541 100644 (file)
@@ -63,7 +63,7 @@ int           maildir_msg_open_new     (struct Mailbox *m, struct Message *msg,
 FILE *        maildir_open_find_message(const char *folder, const char *msg, char **newname);
 void          maildir_parse_flags      (struct Email *e, const char *path);
 struct Email *maildir_parse_message    (enum MailboxType magic, const char *fname, bool is_old, struct Email *e);
-struct Email *maildir_parse_stream     (enum MailboxType magic, FILE *f, const char *fname, bool is_old, struct Email *e);
+struct Email *maildir_parse_stream     (enum MailboxType magic, FILE *fp, const char *fname, bool is_old, struct Email *e);
 bool          maildir_update_flags     (struct Mailbox *m, struct Email *o, struct Email *n);
 int           mh_check_empty           (const char *path);
 #ifdef USE_HCACHE
index 63600e0bdb99bb932fc71b61af9b0b5218c395d0..f8bcd23abae88380306b6d98692def4c4fc0f7ce 100644 (file)
@@ -168,8 +168,6 @@ static void mhs_write_one_sequence(FILE *fp, struct MhSequences *mhs,
  */
 void mh_update_sequences(struct Mailbox *m)
 {
-  FILE *ofp = NULL, *nfp = NULL;
-
   char sequences[PATH_MAX];
   char *tmpfname = NULL;
   char *buf = NULL;
@@ -192,7 +190,8 @@ void mh_update_sequences(struct Mailbox *m)
   snprintf(seq_replied, sizeof(seq_replied), "%s:", NONULL(C_MhSeqReplied));
   snprintf(seq_flagged, sizeof(seq_flagged), "%s:", NONULL(C_MhSeqFlagged));
 
-  if (mh_mkstemp(m, &nfp, &tmpfname) != 0)
+  FILE *fp_new = NULL;
+  if (mh_mkstemp(m, &fp_new, &tmpfname) != 0)
   {
     /* error message? */
     return;
@@ -201,20 +200,20 @@ void mh_update_sequences(struct Mailbox *m)
   snprintf(sequences, sizeof(sequences), "%s/.mh_sequences", m->path);
 
   /* first, copy unknown sequences */
-  ofp = fopen(sequences, "r");
-  if (ofp)
+  FILE *fp_old = fopen(sequences, "r");
+  if (fp_old)
   {
-    while ((buf = mutt_file_read_line(buf, &s, ofp, &l, 0)))
+    while ((buf = mutt_file_read_line(buf, &s, fp_old, &l, 0)))
     {
       if (mutt_str_startswith(buf, seq_unseen, CASE_MATCH) ||
           mutt_str_startswith(buf, seq_flagged, CASE_MATCH) ||
           mutt_str_startswith(buf, seq_replied, CASE_MATCH))
         continue;
 
-      fprintf(nfp, "%s\n", buf);
+      fprintf(fp_new, "%s\n", buf);
     }
   }
-  mutt_file_fclose(&ofp);
+  mutt_file_fclose(&fp_old);
 
   /* now, update our unseen, flagged, and replied sequences */
   for (l = 0; l < m->msg_count; l++)
@@ -250,16 +249,16 @@ void mh_update_sequences(struct Mailbox *m)
 
   /* write out the new sequences */
   if (unseen)
-    mhs_write_one_sequence(nfp, &mhs, MH_SEQ_UNSEEN, NONULL(C_MhSeqUnseen));
+    mhs_write_one_sequence(fp_new, &mhs, MH_SEQ_UNSEEN, NONULL(C_MhSeqUnseen));
   if (flagged)
-    mhs_write_one_sequence(nfp, &mhs, MH_SEQ_FLAGGED, NONULL(C_MhSeqFlagged));
+    mhs_write_one_sequence(fp_new, &mhs, MH_SEQ_FLAGGED, NONULL(C_MhSeqFlagged));
   if (replied)
-    mhs_write_one_sequence(nfp, &mhs, MH_SEQ_REPLIED, NONULL(C_MhSeqReplied));
+    mhs_write_one_sequence(fp_new, &mhs, MH_SEQ_REPLIED, NONULL(C_MhSeqReplied));
 
   mhs_free_sequences(&mhs);
 
   /* try to commit the changes - no guarantee here */
-  mutt_file_fclose(&nfp);
+  mutt_file_fclose(&fp_new);
 
   unlink(sequences);
   if (mutt_file_safe_rename(tmpfname, sequences) != 0)
index 75ed77cd73b983b6d19d03675639eb4d6c762026..e1d9b333b39a3d7e8d165057514553f655419592 100644 (file)
@@ -197,8 +197,6 @@ static void mh_sequences_add_one(struct Mailbox *m, int n, bool unseen, bool fla
   bool flagged_done = false;
   bool replied_done = false;
 
-  FILE *ofp = NULL, *nfp = NULL;
-
   char *tmpfname = NULL;
   char sequences[PATH_MAX];
 
@@ -210,7 +208,8 @@ static void mh_sequences_add_one(struct Mailbox *m, int n, bool unseen, bool fla
   int line = 0;
   size_t sz;
 
-  if (mh_mkstemp(m, &nfp, &tmpfname) == -1)
+  FILE *fp_new = NULL;
+  if (mh_mkstemp(m, &fp_new, &tmpfname) == -1)
     return;
 
   snprintf(seq_unseen, sizeof(seq_unseen), "%s:", NONULL(C_MhSeqUnseen));
@@ -218,41 +217,41 @@ static void mh_sequences_add_one(struct Mailbox *m, int n, bool unseen, bool fla
   snprintf(seq_flagged, sizeof(seq_flagged), "%s:", NONULL(C_MhSeqFlagged));
 
   snprintf(sequences, sizeof(sequences), "%s/.mh_sequences", m->path);
-  ofp = fopen(sequences, "r");
-  if (ofp)
+  FILE *fp_old = fopen(sequences, "r");
+  if (fp_old)
   {
-    while ((buf = mutt_file_read_line(buf, &sz, ofp, &line, 0)))
+    while ((buf = mutt_file_read_line(buf, &sz, fp_old, &line, 0)))
     {
       if (unseen && (strncmp(buf, seq_unseen, mutt_str_strlen(seq_unseen)) == 0))
       {
-        fprintf(nfp, "%s %d\n", buf, n);
+        fprintf(fp_new, "%s %d\n", buf, n);
         unseen_done = true;
       }
       else if (flagged && (strncmp(buf, seq_flagged, mutt_str_strlen(seq_flagged)) == 0))
       {
-        fprintf(nfp, "%s %d\n", buf, n);
+        fprintf(fp_new, "%s %d\n", buf, n);
         flagged_done = true;
       }
       else if (replied && (strncmp(buf, seq_replied, mutt_str_strlen(seq_replied)) == 0))
       {
-        fprintf(nfp, "%s %d\n", buf, n);
+        fprintf(fp_new, "%s %d\n", buf, n);
         replied_done = true;
       }
       else
-        fprintf(nfp, "%s\n", buf);
+        fprintf(fp_new, "%s\n", buf);
     }
   }
-  mutt_file_fclose(&ofp);
+  mutt_file_fclose(&fp_old);
   FREE(&buf);
 
   if (!unseen_done && unseen)
-    fprintf(nfp, "%s: %d\n", NONULL(C_MhSeqUnseen), n);
+    fprintf(fp_new, "%s: %d\n", NONULL(C_MhSeqUnseen), n);
   if (!flagged_done && flagged)
-    fprintf(nfp, "%s: %d\n", NONULL(C_MhSeqFlagged), n);
+    fprintf(fp_new, "%s: %d\n", NONULL(C_MhSeqFlagged), n);
   if (!replied_done && replied)
-    fprintf(nfp, "%s: %d\n", NONULL(C_MhSeqReplied), n);
+    fprintf(fp_new, "%s: %d\n", NONULL(C_MhSeqReplied), n);
 
-  mutt_file_fclose(&nfp);
+  mutt_file_fclose(&fp_new);
 
   unlink(sequences);
   if (mutt_file_safe_rename(tmpfname, sequences) != 0)
@@ -1362,7 +1361,7 @@ void maildir_parse_flags(struct Email *e, const char *path)
 /**
  * maildir_parse_stream - Parse a Maildir message
  * @param magic  Mailbox type, e.g. #MUTT_MAILDIR
- * @param f      Message file handle
+ * @param fp     Message file handle
  * @param fname  Message filename
  * @param is_old true, if the email is old (read)
  * @param e      Email
@@ -1371,16 +1370,16 @@ void maildir_parse_flags(struct Email *e, const char *path)
  * Actually parse a maildir message.  This may also be used to fill
  * out a fake header structure generated by lazy maildir parsing.
  */
-struct Email *maildir_parse_stream(enum MailboxType magic, FILE *f,
+struct Email *maildir_parse_stream(enum MailboxType magic, FILE *fp,
                                    const char *fname, bool is_old, struct Email *e)
 {
   struct stat st;
 
   if (!e)
     e = mutt_email_new();
-  e->env = mutt_rfc822_read_header(f, e, false, false);
+  e->env = mutt_rfc822_read_header(fp, e, false, false);
 
-  fstat(fileno(f), &st);
+  fstat(fileno(fp), &st);
 
   if (!e->received)
     e->received = e->date_sent;
@@ -1416,12 +1415,12 @@ struct Email *maildir_parse_stream(enum MailboxType magic, FILE *f,
 struct Email *maildir_parse_message(enum MailboxType magic, const char *fname,
                                     bool is_old, struct Email *e)
 {
-  FILE *f = fopen(fname, "r");
-  if (!f)
+  FILE *fp = fopen(fname, "r");
+  if (!fp)
     return NULL;
 
-  e = maildir_parse_stream(magic, f, fname, is_old, e);
-  mutt_file_fclose(&f);
+  e = maildir_parse_stream(magic, fp, fname, is_old, e);
+  mutt_file_fclose(&fp);
   return e;
 }
 
diff --git a/main.c b/main.c
index 6bd393d1376917131bc35c40f5c4032ec2e9d308..4478d4efeb550036c68c03fb9e370897c27570ea 100644 (file)
--- a/main.c
+++ b/main.c
@@ -843,8 +843,8 @@ int main(int argc, char *argv[], char *envp[])
   else if (subject || msg || sendflags || draft_file || include_file ||
            !STAILQ_EMPTY(&attach) || optind < argc)
   {
-    FILE *fin = NULL;
-    FILE *fout = NULL;
+    FILE *fp_in = NULL;
+    FILE *fp_out = NULL;
     char *tempfile = NULL, *infile = NULL;
     char *bodytext = NULL, *bodyfile = NULL;
     int rv = 0;
@@ -893,7 +893,7 @@ int main(int argc, char *argv[], char *envp[])
 
     if (infile || bodytext)
     {
-      /* Prepare fin and expanded_infile. */
+      /* Prepare fp_in and expanded_infile. */
       if (infile)
       {
         if (mutt_str_strcmp("-", infile) == 0)
@@ -903,14 +903,14 @@ int main(int argc, char *argv[], char *envp[])
             mutt_error(_("Cannot use -E flag with stdin"));
             goto main_curses; // TEST27: neomutt -E -H -
           }
-          fin = stdin;
+          fp_in = stdin;
         }
         else
         {
           mutt_str_strfcpy(expanded_infile, infile, sizeof(expanded_infile));
           mutt_expand_path(expanded_infile, sizeof(expanded_infile));
-          fin = fopen(expanded_infile, "r");
-          if (!fin)
+          fp_in = fopen(expanded_infile, "r");
+          if (!fp_in)
           {
             mutt_perror(expanded_infile);
             goto main_curses; // TEST28: neomutt -E -H missing
@@ -918,7 +918,7 @@ int main(int argc, char *argv[], char *envp[])
         }
       }
 
-      /* Copy input to a tempfile, and re-point fin to the tempfile.
+      /* Copy input to a tempfile, and re-point fp_in to the tempfile.
        * Note: stdin is always copied to a tempfile, ensuring draft_file
        * can stat and get the correct st_size below.
        */
@@ -928,26 +928,26 @@ int main(int argc, char *argv[], char *envp[])
         mutt_mktemp(buf, sizeof(buf));
         tempfile = mutt_str_strdup(buf);
 
-        fout = mutt_file_fopen(tempfile, "w");
-        if (!fout)
+        fp_out = mutt_file_fopen(tempfile, "w");
+        if (!fp_out)
         {
-          mutt_file_fclose(&fin);
+          mutt_file_fclose(&fp_in);
           mutt_perror(tempfile);
           FREE(&tempfile);
           goto main_curses; // TEST29: neomutt -H existing-file (where tmpdir=/path/to/FILE blocking tmpdir)
         }
-        if (fin)
+        if (fp_in)
         {
-          mutt_file_copy_stream(fin, fout);
-          if (fin != stdin)
-            mutt_file_fclose(&fin);
+          mutt_file_copy_stream(fp_in, fp_out);
+          if (fp_in != stdin)
+            mutt_file_fclose(&fp_in);
         }
         else if (bodytext)
-          fputs(bodytext, fout);
-        mutt_file_fclose(&fout);
+          fputs(bodytext, fp_out);
+        mutt_file_fclose(&fp_out);
 
-        fin = fopen(tempfile, "r");
-        if (!fin)
+        fp_in = fopen(tempfile, "r");
+        if (!fp_in)
         {
           mutt_perror(tempfile);
           FREE(&tempfile);
@@ -972,19 +972,19 @@ int main(int argc, char *argv[], char *envp[])
         sendflags |= SEND_DRAFT_FILE;
 
         /* Set up a "context" header with just enough information so that
-         * mutt_prepare_template() can parse the message in fin.
+         * mutt_prepare_template() can parse the message in fp_in.
          */
         struct Email *context_hdr = mutt_email_new();
         context_hdr->offset = 0;
         context_hdr->content = mutt_body_new();
-        if (fstat(fileno(fin), &st) != 0)
+        if (fstat(fileno(fp_in), &st) != 0)
         {
           mutt_perror(draft_file);
           goto main_curses; // TEST31: can't test
         }
         context_hdr->content->length = st.st_size;
 
-        if (mutt_prepare_template(fin, NULL, msg, context_hdr, false) < 0)
+        if (mutt_prepare_template(fp_in, NULL, msg, context_hdr, false) < 0)
         {
           mutt_error(_("Cannot parse message template: %s"), draft_file);
           mutt_env_free(&opts_env);
@@ -1026,7 +1026,7 @@ int main(int argc, char *argv[], char *envp[])
       else
         bodyfile = tempfile;
 
-      mutt_file_fclose(&fin);
+      mutt_file_fclose(&fp_in);
     }
 
     FREE(&bodytext);
@@ -1078,8 +1078,8 @@ int main(int argc, char *argv[], char *envp[])
           mutt_perror(expanded_infile);
           goto main_curses; // TEST33: neomutt -H read-only -s test john@example.com -E
         }
-        fout = mutt_file_fopen(expanded_infile, "a");
-        if (!fout)
+        fp_out = mutt_file_fopen(expanded_infile, "a");
+        if (!fp_out)
         {
           mutt_perror(expanded_infile);
           goto main_curses; // TEST34: can't test
@@ -1098,17 +1098,17 @@ int main(int argc, char *argv[], char *envp[])
         }
 
         mutt_rfc822_write_header(
-            fout, msg->env, msg->content, MUTT_WRITE_HEADER_POSTPONE, false,
+            fp_out, msg->env, msg->content, MUTT_WRITE_HEADER_POSTPONE, false,
             C_CryptProtectedHeadersRead && mutt_should_hide_protected_subject(msg));
         if (C_ResumeEditedDraftFiles)
-          fprintf(fout, "X-Mutt-Resume-Draft: 1\n");
-        fputc('\n', fout);
-        if ((mutt_write_mime_body(msg->content, fout) == -1))
+          fprintf(fp_out, "X-Mutt-Resume-Draft: 1\n");
+        fputc('\n', fp_out);
+        if ((mutt_write_mime_body(msg->content, fp_out) == -1))
         {
-          mutt_file_fclose(&fout);
+          mutt_file_fclose(&fp_out);
           goto main_curses; // TEST35: can't test
         }
-        mutt_file_fclose(&fout);
+        mutt_file_fclose(&fp_out);
       }
 
       mutt_email_free(&msg);
index 9285eb422258ef21a47aeab81dd2fcee9de626b0..8d63370a83a6cee6a89c784bed9ec9912c52c3fb 100644 (file)
@@ -749,18 +749,18 @@ static bool mbox_has_new(struct Mailbox *m)
 
 /**
  * fseek_last_message - Find the last message in the file
- * @param f File to search
+ * @param fp File to search
  * @retval  0 Success
  * @retval -1 No message found
  */
-static int fseek_last_message(FILE *f)
+static int fseek_last_message(FILE *fp)
 {
   LOFF_T pos;
   char buf[BUFSIZ + 9] = { 0 }; /* 7 for "\n\nFrom " */
   size_t bytes_read;
 
-  fseek(f, 0, SEEK_END);
-  pos = ftello(f);
+  fseek(fp, 0, SEEK_END);
+  pos = ftello(fp);
 
   /* Set 'bytes_read' to the size of the last, probably partial, buf;
    * 0 < 'bytes_read' <= 'BUFSIZ'.  */
@@ -773,8 +773,8 @@ static int fseek_last_message(FILE *f)
   {
     /* we save in the buf at the end the first 7 chars from the last read */
     strncpy(buf + BUFSIZ, buf, 5 + 2); /* 2 == 2 * mutt_str_strlen(CRLF) */
-    fseeko(f, pos, SEEK_SET);
-    bytes_read = fread(buf, sizeof(char), bytes_read, f);
+    fseeko(fp, pos, SEEK_SET);
+    bytes_read = fread(buf, sizeof(char), bytes_read, fp);
     if (bytes_read == 0)
       return -1;
     /* 'i' is Index into 'buf' for scanning.  */
@@ -782,7 +782,7 @@ static int fseek_last_message(FILE *f)
     {
       if (mutt_str_startswith(buf + i, "\n\nFrom ", CASE_MATCH))
       { /* found it - go to the beginning of the From */
-        fseeko(f, pos + i + 2, SEEK_SET);
+        fseeko(fp, pos + i + 2, SEEK_SET);
         return 0;
       }
     }
@@ -792,7 +792,7 @@ static int fseek_last_message(FILE *f)
   /* here we are at the beginning of the file */
   if (mutt_str_startswith(buf, "From ", CASE_MATCH))
   {
-    fseek(f, 0, SEEK_SET);
+    fseek(fp, 0, SEEK_SET);
     return 0;
   }
 
@@ -801,20 +801,20 @@ static int fseek_last_message(FILE *f)
 
 /**
  * test_last_status_new - Is the last message new
- * @param f File to check
+ * @param fp File to check
  * @retval true if the last message is new
  */
-static bool test_last_status_new(FILE *f)
+static bool test_last_status_new(FILE *fp)
 {
   struct Email *e = NULL;
   struct Envelope *tmp_envelope = NULL;
   bool result = false;
 
-  if (fseek_last_message(f) == -1)
+  if (fseek_last_message(fp) == -1)
     return false;
 
   e = mutt_email_new();
-  tmp_envelope = mutt_rfc822_read_header(f, e, false, false);
+  tmp_envelope = mutt_rfc822_read_header(fp, e, false, false);
   if (!(e->read || e->old))
     result = true;
 
@@ -831,7 +831,6 @@ static bool test_last_status_new(FILE *f)
  */
 bool mbox_test_new_folder(const char *path)
 {
-  FILE *f = NULL;
   bool rc = false;
 
   enum MailboxType magic = mx_path_probe(path, NULL);
@@ -839,11 +838,11 @@ bool mbox_test_new_folder(const char *path)
   if ((magic != MUTT_MBOX) && (magic != MUTT_MMDF))
     return false;
 
-  f = fopen(path, "rb");
-  if (f)
+  FILE *fp = fopen(path, "rb");
+  if (fp)
   {
-    rc = test_last_status_new(f);
-    mutt_file_fclose(&f);
+    rc = test_last_status_new(fp);
+    mutt_file_fclose(&fp);
   }
 
   return rc;
index f1a0ef841c485d1bb763c4a17932570396be8587..c4d7a89bd139317b4610079497f6698b0614fbde 100644 (file)
@@ -806,7 +806,7 @@ bool mutt_ch_check_charset(const char *cs, bool strict)
 
 /**
  * mutt_ch_fgetconv_open - Prepare a file for charset conversion
- * @param file  FILE ptr to prepare
+ * @param fp    FILE ptr to prepare
  * @param from  Current character set
  * @param to    Destination character set
  * @param flags Flags, e.g. MUTT_ICONV_HOOK_FROM
@@ -814,7 +814,7 @@ bool mutt_ch_check_charset(const char *cs, bool strict)
  *
  * Parameter flags is given as-is to mutt_ch_iconv_open().
  */
-struct FgetConv *mutt_ch_fgetconv_open(FILE *file, const char *from, const char *to, int flags)
+struct FgetConv *mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, int flags)
 {
   struct FgetConv *fc = NULL;
   iconv_t cd = (iconv_t) -1;
@@ -835,7 +835,7 @@ struct FgetConv *mutt_ch_fgetconv_open(FILE *file, const char *from, const char
   }
   else
     fc = mutt_mem_malloc(sizeof(struct FgetConvNot));
-  fc->fp = file;
+  fc->fp = fp;
   fc->cd = cd;
   return fc;
 }
index 686a6e14fbe5ccf8f7f459a096c555a9d688d0ff..e7a630902e73929a1b8e39d5d3129ebee1555568 100644 (file)
@@ -92,7 +92,7 @@ int              mutt_ch_convert_nonmime_string(char **ps);
 int              mutt_ch_convert_string(char **ps, const char *from, const char *to, int flags);
 int              mutt_ch_fgetconv(struct FgetConv *fc);
 void             mutt_ch_fgetconv_close(struct FgetConv **fc);
-struct FgetConv *mutt_ch_fgetconv_open(FILE *file, const char *from, const char *to, int flags);
+struct FgetConv *mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, int flags);
 char *           mutt_ch_fgetconvs(char *buf, size_t buflen, struct FgetConv *fc);
 char *           mutt_ch_get_default_charset(void);
 char *           mutt_ch_get_langinfo_charset(void);
index 010aaaa9aea41234f902da34346f3f001fb01e4d..d1412872110a028d95d2ac8ce4d68eac95c0ea90 100644 (file)
@@ -142,42 +142,42 @@ static int put_file_in_place(const char *path, const char *safe_file, const char
 
 /**
  * mutt_file_fclose - Close a FILE handle (and NULL the pointer)
- * @param[out] f FILE handle to close
+ * @param[out] fp FILE handle to close
  * @retval 0   Success
  * @retval EOF Error, see errno
  */
-int mutt_file_fclose(FILE **f)
+int mutt_file_fclose(FILE **fp)
 {
-  if (!f || !*f)
+  if (!fp || !*fp)
     return 0;
 
-  int r = fclose(*f);
-  *f = NULL;
+  int r = fclose(*fp);
+  *fp = NULL;
   return r;
 }
 
 /**
  * mutt_file_fsync_close - Flush the data, before closing a file (and NULL the pointer)
- * @param[out] f FILE handle to close
+ * @param[out] fp FILE handle to close
  * @retval 0   Success
  * @retval EOF Error, see errno
  */
-int mutt_file_fsync_close(FILE **f)
+int mutt_file_fsync_close(FILE **fp)
 {
-  if (!f || !*f)
+  if (!fp || !*fp)
     return 0;
 
   int r = 0;
 
-  if (fflush(*f) || fsync(fileno(*f)))
+  if (fflush(*fp) || fsync(fileno(*fp)))
   {
     int save_errno = errno;
     r = -1;
-    mutt_file_fclose(f);
+    mutt_file_fclose(fp);
     errno = save_errno;
   }
   else
-    r = mutt_file_fclose(f);
+    r = mutt_file_fclose(fp);
 
   return r;
 }
@@ -211,67 +211,67 @@ void mutt_file_unlink(const char *s)
     return;
   }
 
-  FILE *f = fdopen(fd, "r+");
-  if (f)
+  FILE *fp = fdopen(fd, "r+");
+  if (fp)
   {
     unlink(s);
     char buf[2048] = { 0 };
     while (sb.st_size > 0)
     {
-      fwrite(buf, 1, MIN(sizeof(buf), sb.st_size), f);
+      fwrite(buf, 1, MIN(sizeof(buf), sb.st_size), fp);
       sb.st_size -= MIN(sizeof(buf), sb.st_size);
     }
-    mutt_file_fclose(&f);
+    mutt_file_fclose(&fp);
   }
 }
 
 /**
  * mutt_file_copy_bytes - Copy some content from one file to another
- * @param in   Source file
- * @param out  Destination file
- * @param size Maximum number of bytes to copy
+ * @param fp_in  Source file
+ * @param fp_out Destination file
+ * @param size   Maximum number of bytes to copy
  * @retval  0 Success
  * @retval -1 Error, see errno
  */
-int mutt_file_copy_bytes(FILE *in, FILE *out, size_t size)
+int mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size)
 {
   while (size > 0)
   {
     char buf[2048];
     size_t chunk = (size > sizeof(buf)) ? sizeof(buf) : size;
-    chunk = fread(buf, 1, chunk, in);
+    chunk = fread(buf, 1, chunk, fp_in);
     if (chunk < 1)
       break;
-    if (fwrite(buf, 1, chunk, out) != chunk)
+    if (fwrite(buf, 1, chunk, fp_out) != chunk)
       return -1;
 
     size -= chunk;
   }
 
-  if (fflush(out) != 0)
+  if (fflush(fp_out) != 0)
     return -1;
   return 0;
 }
 
 /**
  * mutt_file_copy_stream - Copy the contents of one file into another
- * @param fin  Source file
- * @param fout Destination file
+ * @param fp_in  Source file
+ * @param fp_out Destination file
  * @retval  0 Success
  * @retval -1 Error, see errno
  */
-int mutt_file_copy_stream(FILE *fin, FILE *fout)
+int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
 {
   size_t l;
   char buf[1024];
 
-  while ((l = fread(buf, 1, sizeof(buf), fin)) > 0)
+  while ((l = fread(buf, 1, sizeof(buf), fp_in)) > 0)
   {
-    if (fwrite(buf, 1, l, fout) != l)
+    if (fwrite(buf, 1, l, fp_out) != l)
       return -1;
   }
 
-  if (fflush(fout) != 0)
+  if (fflush(fp_out) != 0)
     return -1;
   return 0;
 }
@@ -572,18 +572,18 @@ FILE *mutt_file_fopen(const char *path, const char *mode)
 
 /**
  * mutt_file_sanitize_filename - Replace unsafe characters in a filename
- * @param f     Filename to make safe
+ * @param fp     Filename to make safe
  * @param slash Replace '/' characters too
  */
-void mutt_file_sanitize_filename(char *f, bool slash)
+void mutt_file_sanitize_filename(char *fp, bool slash)
 {
-  if (!f)
+  if (!fp)
     return;
 
-  for (; *f; f++)
+  for (; *fp; fp++)
   {
-    if ((slash && (*f == '/')) || !strchr(safe_chars, *f))
-      *f = '_';
+    if ((slash && (*fp == '/')) || !strchr(safe_chars, *fp))
+      *fp = '_';
   }
 }
 
@@ -874,14 +874,14 @@ FILE *mutt_file_mkstemp_full(const char *file, int line, const char *func)
 
 /**
  * mutt_file_decrease_mtime - Decrease a file's modification time by 1 second
- * @param f  Filename
+ * @param fp Filename
  * @param st struct stat for the file (optional)
  * @retval num Updated Unix mtime
  * @retval -1  Error, see errno
  *
  * If a file's mtime is NOW, then set it to 1 second in the past.
  */
-time_t mutt_file_decrease_mtime(const char *f, struct stat *st)
+time_t mutt_file_decrease_mtime(const char *fp, struct stat *st)
 {
   struct utimbuf utim;
   struct stat st2;
@@ -889,7 +889,7 @@ time_t mutt_file_decrease_mtime(const char *f, struct stat *st)
 
   if (!st)
   {
-    if (stat(f, &st2) == -1)
+    if (stat(fp, &st2) == -1)
       return -1;
     st = &st2;
   }
@@ -900,7 +900,7 @@ time_t mutt_file_decrease_mtime(const char *f, struct stat *st)
     mtime -= 1;
     utim.actime = mtime;
     utim.modtime = mtime;
-    utime(f, &utim);
+    utime(fp, &utim);
   }
 
   return mtime;
@@ -1239,24 +1239,23 @@ void mutt_file_unlink_empty(const char *path)
  */
 int mutt_file_rename(const char *oldfile, const char *newfile)
 {
-  FILE *ofp = NULL, *nfp = NULL;
-
   if (access(oldfile, F_OK) != 0)
     return 1;
   if (access(newfile, F_OK) == 0)
     return 2;
-  ofp = fopen(oldfile, "r");
-  if (!ofp)
+
+  FILE *fp_old = fopen(oldfile, "r");
+  if (!fp_old)
     return 3;
-  nfp = mutt_file_fopen(newfile, "w");
-  if (!nfp)
+  FILE *fp_new = mutt_file_fopen(newfile, "w");
+  if (!fp_new)
   {
-    mutt_file_fclose(&ofp);
+    mutt_file_fclose(&fp_old);
     return 3;
   }
-  mutt_file_copy_stream(ofp, nfp);
-  mutt_file_fclose(&nfp);
-  mutt_file_fclose(&ofp);
+  mutt_file_copy_stream(fp_old, fp_new);
+  mutt_file_fclose(&fp_new);
+  mutt_file_fclose(&fp_old);
   mutt_file_unlink(oldfile);
   return 0;
 }
index 05b5e74706e1fbc227153039b2cb623db033dc9d..50ff76c2118dad0bfd0b4dbc6ef87b7c8c4e6487 100644 (file)
@@ -85,14 +85,14 @@ int         mutt_file_chmod_add(const char *path, mode_t mode);
 int         mutt_file_chmod_add_stat(const char *path, mode_t mode, struct stat *st);
 int         mutt_file_chmod_rm(const char *path, mode_t mode);
 int         mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st);
-int         mutt_file_copy_bytes(FILE *in, FILE *out, size_t size);
-int         mutt_file_copy_stream(FILE *fin, FILE *fout);
-time_t      mutt_file_decrease_mtime(const char *f, struct stat *st);
+int         mutt_file_copy_bytes(FILE *fp_in, FILE *fp_out, size_t size);
+int         mutt_file_copy_stream(FILE *fp_in, FILE *fp_out);
+time_t      mutt_file_decrease_mtime(const char *fp, struct stat *st);
 void        mutt_file_expand_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
 void        mutt_file_expand_fmt_quote(char *dest, size_t destlen, const char *fmt, const char *src);
-int         mutt_file_fclose(FILE **f);
+int         mutt_file_fclose(FILE **fp);
 FILE *      mutt_file_fopen(const char *path, const char *mode);
-int         mutt_file_fsync_close(FILE **f);
+int         mutt_file_fsync_close(FILE **fp);
 long        mutt_file_get_size(const char *path);
 void        mutt_file_get_stat_timespec(struct timespec *dest, struct stat *sb, enum MuttStatType type);
 bool        mutt_file_iter_line(struct MuttFileIter *iter, FILE *fp, int flags);
@@ -108,7 +108,7 @@ char *      mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_nu
 int         mutt_file_rename(const char *oldfile, const char *newfile);
 int         mutt_file_rmtree(const char *path);
 int         mutt_file_safe_rename(const char *src, const char *target);
-void        mutt_file_sanitize_filename(char *f, bool slash);
+void        mutt_file_sanitize_filename(char *fp, bool slash);
 int         mutt_file_sanitize_regex(char *dest, size_t destlen, const char *src);
 void        mutt_file_set_mtime(const char *from, const char *to);
 int         mutt_file_stat_compare(struct stat *sba, enum MuttStatType sba_type, struct stat *sbb, enum MuttStatType sbb_type);
index 5db7fb8d89cd41ca852c17b797168dda0c3de9d2..e2dc5f7c4c55d831c086a4a0822bd31f185091ca 100644 (file)
@@ -204,7 +204,7 @@ static int dup_hash_inc(struct Hash *dup_hash, char *str)
  */
 static void shrink_histfile(void)
 {
-  FILE *tmpfp = NULL;
+  FILE *fp_tmp = NULL;
   int n[HC_MAX] = { 0 };
   int line, hclass, read;
   char *linebuf = NULL, *p = NULL;
@@ -212,8 +212,8 @@ static void shrink_histfile(void)
   bool regen_file = false;
   struct Hash *dup_hashes[HC_MAX] = { 0 };
 
-  FILE *f = fopen(C_HistoryFile, "r");
-  if (!f)
+  FILE *fp = fopen(C_HistoryFile, "r");
+  if (!fp)
     return;
 
   if (C_HistoryRemoveDups)
@@ -221,7 +221,7 @@ static void shrink_histfile(void)
       dup_hashes[hclass] = mutt_hash_new(MAX(10, C_SaveHistory * 2), MUTT_HASH_STRDUP_KEYS);
 
   line = 0;
-  while ((linebuf = mutt_file_read_line(linebuf, &buflen, f, &line, 0)))
+  while ((linebuf = mutt_file_read_line(linebuf, &buflen, fp, &line, 0)))
   {
     if (sscanf(linebuf, "%d:%n", &hclass, &read) < 1 || read == 0 ||
         *(p = linebuf + strlen(linebuf) - 1) != '|' || hclass < 0)
@@ -255,15 +255,15 @@ static void shrink_histfile(void)
 
   if (regen_file)
   {
-    tmpfp = mutt_file_mkstemp();
-    if (!tmpfp)
+    fp_tmp = mutt_file_mkstemp();
+    if (!fp_tmp)
     {
       mutt_perror(_("Can't create temporary file"));
       goto cleanup;
     }
-    rewind(f);
+    rewind(fp);
     line = 0;
-    while ((linebuf = mutt_file_read_line(linebuf, &buflen, f, &line, 0)))
+    while ((linebuf = mutt_file_read_line(linebuf, &buflen, fp, &line, 0)))
     {
       if (sscanf(linebuf, "%d:%n", &hclass, &read) < 1 || read == 0 ||
           *(p = linebuf + strlen(linebuf) - 1) != '|' || hclass < 0)
@@ -280,22 +280,22 @@ static void shrink_histfile(void)
       }
       *p = '|';
       if (n[hclass]-- <= C_SaveHistory)
-        fprintf(tmpfp, "%s\n", linebuf);
+        fprintf(fp_tmp, "%s\n", linebuf);
     }
   }
 
 cleanup:
-  mutt_file_fclose(&f);
+  mutt_file_fclose(&fp);
   FREE(&linebuf);
-  if (tmpfp)
+  if (fp_tmp)
   {
-    if ((fflush(tmpfp) == 0) && (f = fopen(C_HistoryFile, "w")))
+    if ((fflush(fp_tmp) == 0) && (fp = fopen(C_HistoryFile, "w")))
     {
-      rewind(tmpfp);
-      mutt_file_copy_stream(tmpfp, f);
-      mutt_file_fclose(&f);
+      rewind(fp_tmp);
+      mutt_file_copy_stream(fp_tmp, fp);
+      mutt_file_fclose(&fp);
     }
-    mutt_file_fclose(&tmpfp);
+    mutt_file_fclose(&fp_tmp);
   }
   if (C_HistoryRemoveDups)
     for (hclass = 0; hclass < HC_MAX; hclass++)
@@ -310,14 +310,13 @@ cleanup:
 static void save_history(enum HistoryClass hclass, const char *str)
 {
   static int n = 0;
-  FILE *f = NULL;
   char *tmp = NULL;
 
   if (!str || !*str) /* This shouldn't happen, but it's safer. */
     return;
 
-  f = fopen(C_HistoryFile, "a");
-  if (!f)
+  FILE *fp = fopen(C_HistoryFile, "a");
+  if (!fp)
   {
     mutt_perror("fopen");
     return;
@@ -328,18 +327,18 @@ static void save_history(enum HistoryClass hclass, const char *str)
 
   /* Format of a history item (1 line): "<histclass>:<string>|".
    * We add a '|' in order to avoid lines ending with '\'. */
-  fprintf(f, "%d:", (int) hclass);
+  fprintf(fp, "%d:", (int) hclass);
   for (char *p = tmp; *p; p++)
   {
     /* Don't copy \n as a history item must fit on one line. The string
      * shouldn't contain such a character anyway, but as this can happen
      * in practice, we must deal with that. */
     if (*p != '\n')
-      putc((unsigned char) *p, f);
+      putc((unsigned char) *p, fp);
   }
-  fputs("|\n", f);
+  fputs("|\n", fp);
 
-  mutt_file_fclose(&f);
+  mutt_file_fclose(&fp);
   FREE(&tmp);
 
   if (--n < 0)
@@ -591,11 +590,11 @@ void mutt_hist_read_file(void)
   char *linebuf = NULL, *p = NULL;
   size_t buflen;
 
-  FILE *f = fopen(C_HistoryFile, "r");
-  if (!f)
+  FILE *fp = fopen(C_HistoryFile, "r");
+  if (!fp)
     return;
 
-  while ((linebuf = mutt_file_read_line(linebuf, &buflen, f, &line, 0)))
+  while ((linebuf = mutt_file_read_line(linebuf, &buflen, fp, &line, 0)))
   {
     read = 0;
     if (sscanf(linebuf, "%d:%n", &hclass, &read) < 1 || read == 0 ||
@@ -617,7 +616,7 @@ void mutt_hist_read_file(void)
     }
   }
 
-  mutt_file_fclose(&f);
+  mutt_file_fclose(&fp);
   FREE(&linebuf);
 }
 
index 91697f9550910d67b984e3e98d319632a7eb26cb..25062aec0fc5faa47481dc91d4b9443505346b51 100644 (file)
@@ -68,7 +68,6 @@ int mutt_get_tmp_attachment(struct Body *a)
 {
   char type[256];
   char tempfile[PATH_MAX];
-  FILE *fpin = NULL, *fpout = NULL;
   struct stat st;
 
   if (a->unlink)
@@ -84,9 +83,10 @@ int mutt_get_tmp_attachment(struct Body *a)
   if (stat(a->filename, &st) == -1)
     return -1;
 
-  if ((fpin = fopen(a->filename, "r")) && (fpout = mutt_file_fopen(tempfile, "w")))
+  FILE *fp_in = NULL, *fp_out = NULL;
+  if ((fp_in = fopen(a->filename, "r")) && (fp_out = mutt_file_fopen(tempfile, "w")))
   {
-    mutt_file_copy_stream(fpin, fpout);
+    mutt_file_copy_stream(fp_in, fp_out);
     mutt_str_replace(&a->filename, tempfile);
     a->unlink = true;
 
@@ -94,10 +94,10 @@ int mutt_get_tmp_attachment(struct Body *a)
       mutt_stamp_attachment(a);
   }
   else
-    mutt_perror(fpin ? tempfile : a->filename);
+    mutt_perror(fp_in ? tempfile : a->filename);
 
-  mutt_file_fclose(&fpin);
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_in);
+  mutt_file_fclose(&fp_out);
 
   return a->unlink ? 0 : -1;
 }
@@ -193,16 +193,16 @@ int mutt_compose_attachment(struct Body *a)
             fseeko(fp, b->offset, SEEK_SET);
             mutt_body_free(&b);
             mutt_mktemp(tempfile, sizeof(tempfile));
-            FILE *tfp = mutt_file_fopen(tempfile, "w");
-            if (!tfp)
+            FILE *fp_tmp = mutt_file_fopen(tempfile, "w");
+            if (!fp_tmp)
             {
               mutt_perror(_("Failure to open file to strip headers"));
               mutt_file_fclose(&fp);
               goto bailout;
             }
-            mutt_file_copy_stream(fp, tfp);
+            mutt_file_copy_stream(fp, fp_tmp);
             mutt_file_fclose(&fp);
-            mutt_file_fclose(&tfp);
+            mutt_file_fclose(&fp_tmp);
             mutt_file_unlink(a->filename);
             if (mutt_file_rename(tempfile, a->filename) != 0)
             {
@@ -712,11 +712,8 @@ int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfi
   else
   {
     /* send case */
-
-    FILE *ofp = NULL;
-
-    FILE *ifp = fopen(b->filename, "r");
-    if (!ifp)
+    FILE *fp_in = fopen(b->filename, "r");
+    if (!fp_in)
     {
       mutt_perror("fopen");
       if (outfile && *outfile)
@@ -727,21 +724,22 @@ int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfi
       return 0;
     }
 
+    FILE *fp_out = NULL;
     if (outfile && *outfile)
-      pid = mutt_create_filter_fd(path, &ofp, NULL, NULL, -1, out, -1);
+      pid = mutt_create_filter_fd(path, &fp_out, NULL, NULL, -1, out, -1);
     else
-      pid = mutt_create_filter(path, &ofp, NULL, NULL);
+      pid = mutt_create_filter(path, &fp_out, NULL, NULL);
 
     if (pid < 0)
     {
       mutt_perror(_("Can't create filter"));
-      mutt_file_fclose(&ifp);
+      mutt_file_fclose(&fp_in);
       goto bail;
     }
 
-    mutt_file_copy_stream(ifp, ofp);
-    mutt_file_fclose(&ofp);
-    mutt_file_fclose(&ifp);
+    mutt_file_copy_stream(fp_in, fp_out);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_in);
   }
 
   rc = 1;
@@ -872,30 +870,30 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct
 
     /* In send mode, just copy file */
 
-    FILE *ofp = fopen(m->filename, "r");
-    if (!ofp)
+    FILE *fp_old = fopen(m->filename, "r");
+    if (!fp_old)
     {
       mutt_perror("fopen");
       return -1;
     }
 
-    FILE *nfp = save_attachment_open(path, flags);
-    if (!nfp)
+    FILE *fp_new = save_attachment_open(path, flags);
+    if (!fp_new)
     {
       mutt_perror("fopen");
-      mutt_file_fclose(&ofp);
+      mutt_file_fclose(&fp_old);
       return -1;
     }
 
-    if (mutt_file_copy_stream(ofp, nfp) == -1)
+    if (mutt_file_copy_stream(fp_old, fp_new) == -1)
     {
       mutt_error(_("Write fault"));
-      mutt_file_fclose(&ofp);
-      mutt_file_fclose(&nfp);
+      mutt_file_fclose(&fp_old);
+      mutt_file_fclose(&fp_new);
       return -1;
     }
-    mutt_file_fclose(&ofp);
-    if (mutt_file_fsync_close(&nfp) != 0)
+    mutt_file_fclose(&fp_old);
+    if (mutt_file_fsync_close(&fp_new) != 0)
     {
       mutt_error(_("Write fault"));
       return -1;
@@ -1018,7 +1016,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
   char newfile[PATH_MAX] = "";
   char type[256];
   pid_t pid;
-  FILE *ifp = NULL, *fpout = NULL;
+  FILE *fp_in = NULL, *fp_out = NULL;
   bool unlink_newfile = false;
 
   snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
@@ -1062,25 +1060,25 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
     /* interactive program */
     if (piped)
     {
-      ifp = fopen(newfile, "r");
-      if (!ifp)
+      fp_in = fopen(newfile, "r");
+      if (!fp_in)
       {
         mutt_perror("fopen");
         rfc1524_free_entry(&entry);
         return 0;
       }
 
-      pid = mutt_create_filter(cmd, &fpout, NULL, NULL);
+      pid = mutt_create_filter(cmd, &fp_out, NULL, NULL);
       if (pid < 0)
       {
         mutt_perror(_("Can't create filter"));
         rfc1524_free_entry(&entry);
-        mutt_file_fclose(&ifp);
+        mutt_file_fclose(&fp_in);
         return 0;
       }
-      mutt_file_copy_stream(ifp, fpout);
-      mutt_file_fclose(&fpout);
-      mutt_file_fclose(&ifp);
+      mutt_file_copy_stream(fp_in, fp_out);
+      mutt_file_fclose(&fp_out);
+      mutt_file_fclose(&fp_in);
       if (mutt_wait_filter(pid) || C_WaitKey)
         mutt_any_key_to_continue(NULL);
     }
@@ -1114,16 +1112,16 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
 
     int rc = 0;
 
-    ifp = NULL;
-    fpout = NULL;
+    fp_in = NULL;
+    fp_out = NULL;
 
     mutt_mktemp(newfile, sizeof(newfile));
     if (mutt_decode_save_attachment(fp, a, newfile, MUTT_PRINTING, 0) == 0)
     {
       mutt_debug(LL_DEBUG2, "successfully decoded %s type attachment to %s\n", type, newfile);
 
-      ifp = fopen(newfile, "r");
-      if (!ifp)
+      fp_in = fopen(newfile, "r");
+      if (!fp_in)
       {
         mutt_perror("fopen");
         goto bail0;
@@ -1132,7 +1130,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
       mutt_debug(LL_DEBUG2, "successfully opened %s read-only\n", newfile);
 
       mutt_endwin();
-      pid = mutt_create_filter(NONULL(C_PrintCommand), &fpout, NULL, NULL);
+      pid = mutt_create_filter(NONULL(C_PrintCommand), &fp_out, NULL, NULL);
       if (pid < 0)
       {
         mutt_perror(_("Can't create filter"));
@@ -1141,18 +1139,18 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
 
       mutt_debug(LL_DEBUG2, "Filter created.\n");
 
-      mutt_file_copy_stream(ifp, fpout);
+      mutt_file_copy_stream(fp_in, fp_out);
 
-      mutt_file_fclose(&fpout);
-      mutt_file_fclose(&ifp);
+      mutt_file_fclose(&fp_out);
+      mutt_file_fclose(&fp_in);
 
       if (mutt_wait_filter(pid) != 0 || C_WaitKey)
         mutt_any_key_to_continue(NULL);
       rc = 1;
     }
   bail0:
-    mutt_file_fclose(&ifp);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_in);
+    mutt_file_fclose(&fp_out);
     mutt_file_unlink(newfile);
     return rc;
   }
index 838f6bb2d803fa91e4576bdd2169268d618e7812..26d69823e385e59899a134d40b1dd1401570d623 100644 (file)
@@ -180,30 +180,30 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg,
   struct stat st;
 
   mutt_mktemp(path, sizeof(path));
-  FILE *ofp = mutt_file_fopen(path, "w");
-  if (!ofp)
+  FILE *fp_out = mutt_file_fopen(path, "w");
+  if (!fp_out)
   {
     mutt_perror(path);
     return;
   }
 
   mutt_env_to_local(msg->env);
-  mutt_rfc822_write_header(ofp, msg->env, NULL, MUTT_WRITE_HEADER_EDITHDRS, false, false);
-  fputc('\n', ofp); /* tie off the header. */
+  mutt_rfc822_write_header(fp_out, msg->env, NULL, MUTT_WRITE_HEADER_EDITHDRS, false, false);
+  fputc('\n', fp_out); /* tie off the header. */
 
   /* now copy the body of the message. */
-  FILE *ifp = fopen(body, "r");
-  if (!ifp)
+  FILE *fp_in = fopen(body, "r");
+  if (!fp_in)
   {
     mutt_perror(body);
-    mutt_file_fclose(&ofp);
+    mutt_file_fclose(&fp_out);
     return;
   }
 
-  mutt_file_copy_stream(ifp, ofp);
+  mutt_file_copy_stream(fp_in, fp_out);
 
-  mutt_file_fclose(&ifp);
-  mutt_file_fclose(&ofp);
+  mutt_file_fclose(&fp_in);
+  mutt_file_fclose(&fp_out);
 
   if (stat(path, &st) == -1)
   {
@@ -227,27 +227,27 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg,
   mutt_list_free(&msg->env->userhdrs);
 
   /* Read the temp file back in */
-  ifp = fopen(path, "r");
-  if (!ifp)
+  fp_in = fopen(path, "r");
+  if (!fp_in)
   {
     mutt_perror(path);
     return;
   }
 
-  ofp = mutt_file_fopen(body, "w");
-  if (!ofp)
+  fp_out = mutt_file_fopen(body, "w");
+  if (!fp_out)
   {
     /* intentionally leak a possible temporary file here */
-    mutt_file_fclose(&ifp);
+    mutt_file_fclose(&fp_in);
     mutt_perror(body);
     return;
   }
 
-  n = mutt_rfc822_read_header(ifp, NULL, true, false);
-  while ((i = fread(buf, 1, sizeof(buf), ifp)) > 0)
-    fwrite(buf, 1, i, ofp);
-  mutt_file_fclose(&ofp);
-  mutt_file_fclose(&ifp);
+  n = mutt_rfc822_read_header(fp_in, NULL, true, false);
+  while ((i = fread(buf, 1, sizeof(buf), fp_in)) > 0)
+    fwrite(buf, 1, i, fp_out);
+  mutt_file_fclose(&fp_out);
+  mutt_file_fclose(&fp_in);
   mutt_file_unlink(path);
 
   /* in case the user modifies/removes the In-Reply-To header with
index 0f31de7337e41e2486f5b1c1fc4546a5047836fa..a13631e69f1521ca37cfc0f321e577dcfae535e6 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -450,7 +450,7 @@ bool mutt_is_text_part(struct Body *b)
   return false;
 }
 
-static FILE *frandom;
+static FILE *fp_random;
 
 /**
  * mutt_randbuf - Fill a buffer with randomness
@@ -478,17 +478,17 @@ int mutt_randbuf(void *buf, size_t buflen)
 #endif
   /* let's try urandom in case we're on an old kernel, or the user has
    * configured selinux, seccomp or something to not allow getrandom */
-  if (!frandom)
+  if (!fp_random)
   {
-    frandom = fopen("/dev/urandom", "rb");
-    if (!frandom)
+    fp_random = fopen("/dev/urandom", "rb");
+    if (!fp_random)
     {
       mutt_error(_("open /dev/urandom: %s"), strerror(errno));
       return -1;
     }
-    setbuf(frandom, NULL);
+    setbuf(fp_random, NULL);
   }
-  if (fread(buf, 1, buflen, frandom) != buflen)
+  if (fread(buf, 1, buflen, fp_random) != buflen)
   {
     mutt_error(_("read /dev/urandom: %s"), strerror(errno));
     return -1;
@@ -818,7 +818,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
   char prefix[128], tmp[1024], *cp = NULL, *wptr = buf, ch;
   char if_str[128], else_str[128];
   size_t wlen, count, len, wid;
-  FILE *filter = NULL;
+  FILE *fp_filter = NULL;
   char *recycler = NULL;
 
   char src2[256];
@@ -895,13 +895,13 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
 
       col -= wlen; /* reset to passed in value */
       wptr = buf;  /* reset write ptr */
-      pid_t pid = mutt_create_filter(cmd->data, NULL, &filter, NULL);
+      pid_t pid = mutt_create_filter(cmd->data, NULL, &fp_filter, NULL);
       if (pid != -1)
       {
         int rc;
 
-        n = fread(buf, 1, buflen /* already decremented */, filter);
-        mutt_file_fclose(&filter);
+        n = fread(buf, 1, buflen /* already decremented */, fp_filter);
+        mutt_file_fclose(&fp_filter);
         rc = mutt_wait_filter(pid);
         if (rc != 0)
           mutt_debug(LL_DEBUG1, "format pipe cmd exited code %d\n", rc);
@@ -1336,7 +1336,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c
  */
 FILE *mutt_open_read(const char *path, pid_t *thepid)
 {
-  FILE *f = NULL;
+  FILE *fp = NULL;
   struct stat s;
 
   size_t len = mutt_str_strlen(path);
@@ -1353,7 +1353,7 @@ FILE *mutt_open_read(const char *path, pid_t *thepid)
 
     p[len - 1] = 0;
     mutt_endwin();
-    *thepid = mutt_create_filter(p, NULL, &f, NULL);
+    *thepid = mutt_create_filter(p, NULL, &fp, NULL);
     FREE(&p);
   }
   else
@@ -1365,10 +1365,10 @@ FILE *mutt_open_read(const char *path, pid_t *thepid)
       errno = EINVAL;
       return NULL;
     }
-    f = fopen(path, "r");
+    fp = fopen(path, "r");
     *thepid = -1;
   }
-  return f;
+  return fp;
 }
 
 /**
index 9d80a77cf4ffd9300ca0c5673c262786e7cb3c58..fe531796cb1b97b67a1afa9b3b2db04811f615f4 100644 (file)
@@ -827,14 +827,13 @@ void crypt_extract_keys_from_messages(struct EmailList *el)
 {
   char tempfname[PATH_MAX], *mbox = NULL;
   struct Address *tmp = NULL;
-  FILE *fpout = NULL;
 
   if (!WithCrypto)
     return;
 
   mutt_mktemp(tempfname, sizeof(tempfname));
-  fpout = mutt_file_fopen(tempfname, "w");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfname, "w");
+  if (!fp_out)
   {
     mutt_perror(tempfname);
     return;
@@ -851,15 +850,15 @@ void crypt_extract_keys_from_messages(struct EmailList *el)
     mutt_parse_mime_message(Context->mailbox, e);
     if (e->security & SEC_ENCRYPT && !crypt_valid_passphrase(e->security))
     {
-      mutt_file_fclose(&fpout);
+      mutt_file_fclose(&fp_out);
       break;
     }
 
     if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP))
     {
-      mutt_copy_message_ctx(fpout, Context->mailbox, e,
+      mutt_copy_message_ctx(fp_out, Context->mailbox, e,
                             MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0);
-      fflush(fpout);
+      fflush(fp_out);
 
       mutt_endwin();
       puts(_("Trying to extract PGP keys...\n"));
@@ -870,13 +869,13 @@ void crypt_extract_keys_from_messages(struct EmailList *el)
     {
       if (e->security & SEC_ENCRYPT)
       {
-        mutt_copy_message_ctx(fpout, Context->mailbox, e,
+        mutt_copy_message_ctx(fp_out, Context->mailbox, e,
                               MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME,
                               0);
       }
       else
-        mutt_copy_message_ctx(fpout, Context->mailbox, e, 0, 0);
-      fflush(fpout);
+        mutt_copy_message_ctx(fp_out, Context->mailbox, e, 0, 0);
+      fflush(fp_out);
 
       if (e->env->from)
         tmp = mutt_expand_aliases(e->env->from);
@@ -892,10 +891,10 @@ void crypt_extract_keys_from_messages(struct EmailList *el)
       }
     }
 
-    rewind(fpout);
+    rewind(fp_out);
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
   if (isendwin())
     mutt_any_key_to_continue(NULL);
 
index 697b22297f7f4526d170e56d9c2a83a046170efe..ccceca5db937da9630c5c37eaa70f3e8d06f1965 100644 (file)
@@ -805,16 +805,16 @@ static gpgme_data_t body_to_data_object(struct Body *a, bool convert)
   gpgme_data_t data;
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *fptmp = mutt_file_fopen(tempfile, "w+");
-  if (!fptmp)
+  FILE *fp_tmp = mutt_file_fopen(tempfile, "w+");
+  if (!fp_tmp)
   {
     mutt_perror(tempfile);
     return NULL;
   }
 
-  mutt_write_mime_header(a, fptmp);
-  fputc('\n', fptmp);
-  mutt_write_mime_body(a, fptmp);
+  mutt_write_mime_header(a, fp_tmp);
+  fputc('\n', fp_tmp);
+  mutt_write_mime_body(a, fp_tmp);
 
   if (convert)
   {
@@ -822,8 +822,8 @@ static gpgme_data_t body_to_data_object(struct Body *a, bool convert)
     unsigned char buf[1];
 
     data = create_gpgme_data();
-    rewind(fptmp);
-    while ((c = fgetc(fptmp)) != EOF)
+    rewind(fp_tmp);
+    while ((c = fgetc(fp_tmp)) != EOF)
     {
       if (c == '\r')
         hadcr = 1;
@@ -841,12 +841,12 @@ static gpgme_data_t body_to_data_object(struct Body *a, bool convert)
       buf[0] = c;
       gpgme_data_write(data, buf, 1);
     }
-    mutt_file_fclose(&fptmp);
+    mutt_file_fclose(&fp_tmp);
     gpgme_data_seek(data, 0, SEEK_SET);
   }
   else
   {
-    mutt_file_fclose(&fptmp);
+    mutt_file_fclose(&fp_tmp);
     err = gpgme_data_new_from_file(&data, tempfile, 1);
   }
   unlink(tempfile);
@@ -928,15 +928,15 @@ static int data_object_to_stream(gpgme_data_t data, FILE *fp)
 /**
  * data_object_to_tempfile - Copy a data object to a temporary file
  * @param[in]  data   GPGME data object
- * @param[out] ret_fp Temporary file
+ * @param[out] fp_ret Temporary file
  * @retval ptr Name of temporary file
  *
- * If ret_fp is passed in, the file will be rewound, left open, and returned
+ * If fp_ret is passed in, the file will be rewound, left open, and returned
  * via that parameter.
  *
  * @note The caller must free the returned file name
  */
-static char *data_object_to_tempfile(gpgme_data_t data, FILE **ret_fp)
+static char *data_object_to_tempfile(gpgme_data_t data, FILE **fp_ret)
 {
   int err;
   char tempf[PATH_MAX];
@@ -966,7 +966,7 @@ static char *data_object_to_tempfile(gpgme_data_t data, FILE **ret_fp)
       }
     }
   }
-  if (ret_fp)
+  if (fp_ret)
     rewind(fp);
   else
     mutt_file_fclose(&fp);
@@ -977,8 +977,8 @@ static char *data_object_to_tempfile(gpgme_data_t data, FILE **ret_fp)
     mutt_file_fclose(&fp);
     return NULL;
   }
-  if (ret_fp)
-    *ret_fp = fp;
+  if (fp_ret)
+    *fp_ret = fp;
   return mutt_str_strdup(tempf);
 }
 
@@ -2073,7 +2073,7 @@ int smime_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tem
  * decrypt_part - Decrypt a PGP or SMIME message
  * @param[in]  a           Body of message
  * @param[in]  s           State to use
- * @param[in]  fpout       File to write to
+ * @param[in]  fp_out       File to write to
  * @param[in]  is_smime    True if an SMIME message
  * @param[out] r_is_signed Flag, R_IS_SIGNED (PGP only)
  * @retval ptr Newly allocated Body
@@ -2082,10 +2082,10 @@ int smime_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tem
  * encrypted and signed message, for S/MIME it returns true when it is not a
  * encrypted but a signed message.
  */
-static struct Body *decrypt_part(struct Body *a, struct State *s, FILE *fpout,
+static struct Body *decrypt_part(struct Body *a, struct State *s, FILE *fp_out,
                                  bool is_smime, int *r_is_signed)
 {
-  if (!a || !s || !fpout)
+  if (!a || !s || !fp_out)
     return NULL;
 
   struct stat info;
@@ -2169,7 +2169,7 @@ restart:
 
   /* Read the output from GPGME, and make sure to change CRLF to LF,
      otherwise read_mime_header has a hard time parsing the message.  */
-  if (data_object_to_stream(plaintext, fpout))
+  if (data_object_to_stream(plaintext, fp_out))
   {
     gpgme_data_release(plaintext);
     gpgme_release(ctx);
@@ -2214,19 +2214,19 @@ restart:
   gpgme_release(ctx);
   ctx = NULL;
 
-  fflush(fpout);
-  rewind(fpout);
-  tattach = mutt_read_mime_header(fpout, 0);
+  fflush(fp_out);
+  rewind(fp_out);
+  tattach = mutt_read_mime_header(fp_out, 0);
   if (tattach)
   {
     /* Need to set the length of this body part.  */
-    fstat(fileno(fpout), &info);
+    fstat(fileno(fp_out), &info);
     tattach->length = info.st_size - tattach->offset;
 
     tattach->warnsig = anywarn;
 
     /* See if we need to recurse on this MIME part.  */
-    mutt_parse_part(fpout, tattach);
+    mutt_parse_part(fp_out, tattach);
   }
 
   return tattach;
@@ -2235,7 +2235,7 @@ restart:
 /**
  * pgp_gpgme_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
  */
-int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int pgp_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   struct State s = { 0 };
   struct Body *first_part = b;
@@ -2244,7 +2244,7 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
   int saved_type = 0;
   LOFF_T saved_offset = 0;
   size_t saved_length = 0;
-  FILE *decoded_fp = NULL;
+  FILE *fp_decoded = NULL;
   int rc = 0;
 
   first_part->goodsig = false;
@@ -2265,7 +2265,7 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
   else
     return -1;
 
-  s.fp_in = fpin;
+  s.fp_in = fp_in;
 
   if (need_decode)
   {
@@ -2273,38 +2273,38 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
     saved_offset = b->offset;
     saved_length = b->length;
 
-    decoded_fp = mutt_file_mkstemp();
-    if (!decoded_fp)
+    fp_decoded = mutt_file_mkstemp();
+    if (!fp_decoded)
     {
       mutt_perror(_("Can't create temporary file"));
       return -1;
     }
 
     fseeko(s.fp_in, b->offset, SEEK_SET);
-    s.fp_out = decoded_fp;
+    s.fp_out = fp_decoded;
 
     mutt_decode_attachment(b, &s);
 
-    fflush(decoded_fp);
-    b->length = ftello(decoded_fp);
+    fflush(fp_decoded);
+    b->length = ftello(fp_decoded);
     b->offset = 0;
-    rewind(decoded_fp);
-    s.fp_in = decoded_fp;
+    rewind(fp_decoded);
+    s.fp_in = fp_decoded;
     s.fp_out = 0;
   }
 
-  *fpout = mutt_file_mkstemp();
-  if (!*fpout)
+  *fp_out = mutt_file_mkstemp();
+  if (!*fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     rc = -1;
     goto bail;
   }
 
-  *cur = decrypt_part(b, &s, *fpout, false, &is_signed);
+  *cur = decrypt_part(b, &s, *fp_out, false, &is_signed);
   if (!*cur)
     rc = -1;
-  rewind(*fpout);
+  rewind(*fp_out);
   if (is_signed > 0)
     first_part->goodsig = true;
 
@@ -2314,7 +2314,7 @@ bail:
     b->type = saved_type;
     b->length = saved_length;
     b->offset = saved_offset;
-    mutt_file_fclose(&decoded_fp);
+    mutt_file_fclose(&fp_decoded);
   }
 
   return rc;
@@ -2323,7 +2323,7 @@ bail:
 /**
  * smime_gpgme_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
  */
-int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int smime_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   struct State s = { 0 };
   int is_signed;
@@ -2344,40 +2344,40 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
   saved_b_type = b->type;
   saved_b_offset = b->offset;
   saved_b_length = b->length;
-  s.fp_in = fpin;
+  s.fp_in = fp_in;
   fseeko(s.fp_in, b->offset, SEEK_SET);
-  FILE *tmpfp = mutt_file_mkstemp();
-  if (!tmpfp)
+  FILE *fp_tmp = mutt_file_mkstemp();
+  if (!fp_tmp)
   {
     mutt_perror(_("Can't create temporary file"));
     return -1;
   }
 
-  s.fp_out = tmpfp;
+  s.fp_out = fp_tmp;
   mutt_decode_attachment(b, &s);
-  fflush(tmpfp);
+  fflush(fp_tmp);
   b->length = ftello(s.fp_out);
   b->offset = 0;
-  rewind(tmpfp);
+  rewind(fp_tmp);
 
   memset(&s, 0, sizeof(s));
-  s.fp_in = tmpfp;
+  s.fp_in = fp_tmp;
   s.fp_out = 0;
-  *fpout = mutt_file_mkstemp();
-  if (!*fpout)
+  *fp_out = mutt_file_mkstemp();
+  if (!*fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     return -1;
   }
 
-  *cur = decrypt_part(b, &s, *fpout, true, &is_signed);
+  *cur = decrypt_part(b, &s, *fp_out, true, &is_signed);
   if (*cur)
     (*cur)->goodsig = is_signed > 0;
   b->type = saved_b_type;
   b->length = saved_b_length;
   b->offset = saved_b_offset;
-  mutt_file_fclose(&tmpfp);
-  rewind(*fpout);
+  mutt_file_fclose(&fp_tmp);
+  rewind(*fp_out);
   if (*cur && !is_signed && !(*cur)->parts && mutt_is_application_smime(*cur))
   {
     /* Assume that this is a opaque signed s/mime message.  This is
@@ -2396,41 +2396,41 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
     saved_b_offset = bb->offset;
     saved_b_length = bb->length;
     memset(&s, 0, sizeof(s));
-    s.fp_in = *fpout;
+    s.fp_in = *fp_out;
     fseeko(s.fp_in, bb->offset, SEEK_SET);
-    FILE *tmpfp2 = mutt_file_mkstemp();
-    if (!tmpfp2)
+    FILE *fp_tmp2 = mutt_file_mkstemp();
+    if (!fp_tmp2)
     {
       mutt_perror(_("Can't create temporary file"));
       return -1;
     }
 
-    s.fp_out = tmpfp2;
+    s.fp_out = fp_tmp2;
     mutt_decode_attachment(bb, &s);
-    fflush(tmpfp2);
+    fflush(fp_tmp2);
     bb->length = ftello(s.fp_out);
     bb->offset = 0;
-    rewind(tmpfp2);
-    mutt_file_fclose(fpout);
+    rewind(fp_tmp2);
+    mutt_file_fclose(fp_out);
 
     memset(&s, 0, sizeof(s));
-    s.fp_in = tmpfp2;
+    s.fp_in = fp_tmp2;
     s.fp_out = 0;
-    *fpout = mutt_file_mkstemp();
-    if (!*fpout)
+    *fp_out = mutt_file_mkstemp();
+    if (!*fp_out)
     {
       mutt_perror(_("Can't create temporary file"));
       return -1;
     }
 
-    tmp_b = decrypt_part(bb, &s, *fpout, true, &is_signed);
+    tmp_b = decrypt_part(bb, &s, *fp_out, true, &is_signed);
     if (tmp_b)
       tmp_b->goodsig = is_signed > 0;
     bb->type = saved_b_type;
     bb->length = saved_b_length;
     bb->offset = saved_b_offset;
-    mutt_file_fclose(&tmpfp2);
-    rewind(*fpout);
+    mutt_file_fclose(&fp_tmp2);
+    rewind(*fp_out);
     mutt_body_free(cur);
     *cur = tmp_b;
   }
@@ -2606,7 +2606,6 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
 {
   char tempfile[PATH_MAX];
   char buf[8192];
-  FILE *tfp = NULL;
 
   bool sgn = false;
   bool enc = false;
@@ -2621,14 +2620,14 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
     return 0;
   }
 
-  tfp = fopen(tempfile, "r");
-  if (!tfp)
+  FILE *fp_tmp = fopen(tempfile, "r");
+  if (!fp_tmp)
   {
     unlink(tempfile);
     return 0;
   }
 
-  while (fgets(buf, sizeof(buf), tfp))
+  while (fgets(buf, sizeof(buf), fp_tmp))
   {
     size_t plen = mutt_str_startswith(buf, "-----BEGIN PGP ", CASE_MATCH);
     if (plen != 0)
@@ -2645,7 +2644,7 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
       }
     }
   }
-  mutt_file_fclose(&tfp);
+  mutt_file_fclose(&fp_tmp);
   unlink(tempfile);
 
   if (!enc && !sgn)
@@ -2695,16 +2694,16 @@ void pgp_gpgme_invoke_import(const char *fname)
   gpgme_import_status_t st;
   int any;
 
-  FILE *in = mutt_file_fopen(fname, "r");
-  if (!in)
+  FILE *fp_in = mutt_file_fopen(fname, "r");
+  if (!fp_in)
   {
     mutt_perror(fname);
     goto leave;
   }
-  /* Note that the stream, "in", needs to be kept open while the keydata
+  /* Note that the stream, "fp_in", needs to be kept open while the keydata
    * is used.
    */
-  gpgme_error_t err = gpgme_data_new_from_stream(&keydata, in);
+  gpgme_error_t err = gpgme_data_new_from_stream(&keydata, fp_in);
   if (err != GPG_ERR_NO_ERROR)
   {
     mutt_error(_("error allocating data object: %s"), gpgme_strerror(err));
@@ -2778,7 +2777,7 @@ void pgp_gpgme_invoke_import(const char *fname)
 leave:
   gpgme_release(ctx);
   gpgme_data_release(keydata);
-  mutt_file_fclose(&in);
+  mutt_file_fclose(&fp_in);
 }
 
 /**
@@ -2861,7 +2860,7 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
   long bytes;
   LOFF_T last_pos;
   char buf[8192];
-  FILE *pgpout = NULL;
+  FILE *fp_out = NULL;
 
   gpgme_error_t err = 0;
   gpgme_data_t armored_data = NULL;
@@ -2924,7 +2923,7 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
       /* Invoke PGP if needed */
       if (pgp_keyblock)
       {
-        pgp_gpgme_extract_keys(armored_data, &pgpout);
+        pgp_gpgme_extract_keys(armored_data, &fp_out);
       }
       else if (!clearsign || (s->flags & MUTT_VERIFY))
       {
@@ -2998,10 +2997,10 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
                               s);
           }
 
-          tmpfname = data_object_to_tempfile(plaintext, &pgpout);
+          tmpfname = data_object_to_tempfile(plaintext, &fp_out);
           if (!tmpfname)
           {
-            mutt_file_fclose(&pgpout);
+            mutt_file_fclose(&fp_out);
             state_puts(_("Error: copy data failed\n"), s);
           }
           else
@@ -3032,11 +3031,11 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
       {
         copy_clearsigned(armored_data, s, body_charset);
       }
-      else if (pgpout)
+      else if (fp_out)
       {
         int c;
-        rewind(pgpout);
-        struct FgetConv *fc = mutt_ch_fgetconv_open(pgpout, "utf-8", C_Charset, 0);
+        rewind(fp_out);
+        struct FgetConv *fc = mutt_ch_fgetconv_open(fp_out, "utf-8", C_Charset, 0);
         while ((c = mutt_ch_fgetconv(fc)) != EOF)
         {
           state_putc(c, s);
@@ -3058,9 +3057,9 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
       }
 
       gpgme_data_release(armored_data);
-      if (pgpout)
+      if (fp_out)
       {
-        mutt_file_fclose(&pgpout);
+        mutt_file_fclose(&fp_out);
       }
     }
     else
@@ -3100,8 +3099,8 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
 
   mutt_debug(LL_DEBUG2, "Entering handler\n");
 
-  FILE *fpout = mutt_file_mkstemp();
-  if (!fpout)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     if (s->flags & MUTT_DISPLAY)
@@ -3113,7 +3112,7 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
     return -1;
   }
 
-  struct Body *tattach = decrypt_part(a, s, fpout, false, &is_signed);
+  struct Body *tattach = decrypt_part(a, s, fp_out, false, &is_signed);
   if (tattach)
   {
     tattach->goodsig = is_signed > 0;
@@ -3137,10 +3136,10 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
     tattach->mime_headers = NULL;
 
     {
-      FILE *savefp = s->fp_in;
-      s->fp_in = fpout;
+      FILE *fp_save = s->fp_in;
+      s->fp_in = fp_out;
       rc = mutt_body_handler(tattach, s);
-      s->fp_in = savefp;
+      s->fp_in = fp_save;
     }
 
     /* Embedded multipart signed protected headers override the
@@ -3178,7 +3177,7 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
     rc = -1;
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
   mutt_debug(LL_DEBUG2, "Leaving handler\n");
 
   return rc;
@@ -3197,8 +3196,8 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s)
   /* clear out any mime headers before the handler, so they can't be spoofed. */
   mutt_env_free(&a->mime_headers);
   a->warnsig = false;
-  FILE *fpout = mutt_file_mkstemp();
-  if (!fpout)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     if (s->flags & MUTT_DISPLAY)
@@ -3210,7 +3209,7 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s)
     return -1;
   }
 
-  struct Body *tattach = decrypt_part(a, s, fpout, true, &is_signed);
+  struct Body *tattach = decrypt_part(a, s, fp_out, true, &is_signed);
   if (tattach)
   {
     tattach->goodsig = is_signed > 0;
@@ -3233,10 +3232,10 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s)
     tattach->mime_headers = NULL;
 
     {
-      FILE *savefp = s->fp_in;
-      s->fp_in = fpout;
+      FILE *fp_save = s->fp_in;
+      s->fp_in = fp_out;
       rc = mutt_body_handler(tattach, s);
-      s->fp_in = savefp;
+      s->fp_in = fp_save;
     }
 
     /* Embedded multipart signed protected headers override the
@@ -3275,7 +3274,7 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s)
     mutt_body_free(&tattach);
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
   mutt_debug(LL_DEBUG2, "Leaving handler\n");
 
   return rc;
index 1854469e95a97181c5e5c86c63a2a9b0d757648c..49fa8e4d85ecca76f350e770ba7b01a5809e92a4 100644 (file)
@@ -35,7 +35,7 @@ void         pgp_gpgme_set_sender(const char *sender);
 
 int          pgp_gpgme_application_handler(struct Body *m, struct State *s);
 int          pgp_gpgme_check_traditional(FILE *fp, struct Body *b, bool just_one);
-int          pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+int          pgp_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 int          pgp_gpgme_encrypted_handler(struct Body *a, struct State *s);
 struct Body *pgp_gpgme_encrypt_message(struct Body *a, char *keylist, bool sign);
 char *       pgp_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
@@ -48,7 +48,7 @@ int          pgp_gpgme_verify_one(struct Body *sigbdy, struct State *s, const ch
 
 int          smime_gpgme_application_handler(struct Body *a, struct State *s);
 struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist);
-int          smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+int          smime_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 char *       smime_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
 void         smime_gpgme_init(void);
 int          smime_gpgme_send_menu(struct Email *msg);
index f09fd3964eb49a1d6ed6503984ccb3412cc410f0..147afc15715741a86606c6d11929101b15d42a04 100644 (file)
@@ -61,14 +61,14 @@ struct CryptModuleSpecs
   int          (*valid_passphrase)(void);
   /**
    * decrypt_mime - Decrypt an encrypted MIME part
-   * @param[in]  fpin  File containing the encrypted part
-   * @param[out] fpout File containing the decrypted part
-   * @param[in]  b     Body of the email
-   * @param[out] cur   Body containing the decrypted part
+   * @param[in]  fp_in  File containing the encrypted part
+   * @param[out] fp_out File containing the decrypted part
+   * @param[in]  b      Body of the email
+   * @param[out] cur    Body containing the decrypted part
    * @retval  0 Success
    * @retval -1 Failure
    */
-  int          (*decrypt_mime)(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+  int          (*decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
   /**
    * application_handler - Manage the MIME type "application/pgp" or "application/smime"
    * @param m Body of the email
index e49315379f43b20e8f6fa46c0f7e3f7f77bc948a..c819e2c52cd327d423067b641764eb7a8fd60ce1 100644 (file)
@@ -189,10 +189,10 @@ int crypt_pgp_valid_passphrase(void)
 /**
  * crypt_pgp_decrypt_mime - Wrapper for CryptModuleSpecs::decrypt_mime()
  */
-int crypt_pgp_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   if (CRYPT_MOD_CALL_CHECK(PGP, decrypt_mime))
-    return CRYPT_MOD_CALL(PGP, decrypt_mime)(fpin, fpout, b, cur);
+    return CRYPT_MOD_CALL(PGP, decrypt_mime)(fp_in, fp_out, b, cur);
 
   return -1;
 }
@@ -370,10 +370,10 @@ int crypt_smime_valid_passphrase(void)
 /**
  * crypt_smime_decrypt_mime - Wrapper for CryptModuleSpecs::decrypt_mime()
  */
-int crypt_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d)
+int crypt_smime_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   if (CRYPT_MOD_CALL_CHECK(SMIME, decrypt_mime))
-    return CRYPT_MOD_CALL(SMIME, decrypt_mime)(a, b, c, d);
+    return CRYPT_MOD_CALL(SMIME, decrypt_mime)(fp_in, fp_out, b, cur);
 
   return -1;
 }
index 9df78886b53e8af8afdd7243c7feb31dd6d55300..4913cd10676bddf8d33fb067cf10a1e6981213af 100644 (file)
@@ -202,14 +202,14 @@ void         crypt_init(void);
 void         crypt_invoke_message(SecurityFlags type);
 int          crypt_pgp_application_handler(struct Body *m, struct State *s);
 int          crypt_pgp_check_traditional(FILE *fp, struct Body *b, bool just_one);
-int          crypt_pgp_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d);
+int          crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 int          crypt_pgp_encrypted_handler(struct Body *a, struct State *s);
 void         crypt_pgp_extract_key_from_attachment(FILE *fp, struct Body *top);
 void         crypt_pgp_invoke_getkeys(struct Address *addr);
 struct Body *crypt_pgp_make_key_attachment(void);
 int          crypt_pgp_send_menu(struct Email *msg);
 int          crypt_smime_application_handler(struct Body *m, struct State *s);
-int          crypt_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d);
+int          crypt_smime_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 void         crypt_smime_getkeys(struct Envelope *env);
 int          crypt_smime_send_menu(struct Email *msg);
 int          crypt_smime_verify_sender(struct Email *e);
index b8e0401beea4949bd64625ecc15cc7724514c70a..6fecb013395d08c39b633047d408473055317b54 100644 (file)
@@ -241,14 +241,14 @@ char *pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
 
 /**
  * pgp_copy_checksig - Copy PGP output and look for signs of a good signature
- * @param fpin  File to read from
- * @param fpout File to write to
+ * @param fp_in  File to read from
+ * @param fp_out File to write to
  * @retval  0 Success
  * @retval -1 Error
  */
-static int pgp_copy_checksig(FILE *fpin, FILE *fpout)
+static int pgp_copy_checksig(FILE *fp_in, FILE *fp_out)
 {
-  if (!fpin || !fpout)
+  if (!fp_in || !fp_out)
     return -1;
 
   int rc = -1;
@@ -259,7 +259,7 @@ static int pgp_copy_checksig(FILE *fpin, FILE *fpout)
     int lineno = 0;
     size_t linelen;
 
-    while ((line = mutt_file_read_line(line, &linelen, fpin, &lineno, 0)))
+    while ((line = mutt_file_read_line(line, &linelen, fp_in, &lineno, 0)))
     {
       if (regexec(C_PgpGoodSign->regex, line, 0, NULL, 0) == 0)
       {
@@ -271,15 +271,15 @@ static int pgp_copy_checksig(FILE *fpin, FILE *fpout)
 
       if (strncmp(line, "[GNUPG:] ", 9) == 0)
         continue;
-      fputs(line, fpout);
-      fputc('\n', fpout);
+      fputs(line, fp_out);
+      fputc('\n', fp_out);
     }
     FREE(&line);
   }
   else
   {
     mutt_debug(LL_DEBUG2, "No pattern.\n");
-    mutt_file_copy_stream(fpin, fpout);
+    mutt_file_copy_stream(fp_in, fp_out);
     rc = 1;
   }
 
@@ -288,7 +288,7 @@ static int pgp_copy_checksig(FILE *fpin, FILE *fpout)
 
 /**
  * pgp_check_pgp_decryption_okay_regex - Check PGP output to look for successful outcome
- * @param fpin File to read from
+ * @param fp_in File to read from
  * @retval  0 Success
  * @retval -1 Error
  *
@@ -296,7 +296,7 @@ static int pgp_copy_checksig(FILE *fpin, FILE *fpout)
  * This protects against messages with multipart/encrypted headers but which
  * aren't actually encrypted.  See ticket #3770
  */
-static int pgp_check_pgp_decryption_okay_regex(FILE *fpin)
+static int pgp_check_pgp_decryption_okay_regex(FILE *fp_in)
 {
   int rc = -1;
 
@@ -306,7 +306,7 @@ static int pgp_check_pgp_decryption_okay_regex(FILE *fpin)
     int lineno = 0;
     size_t linelen;
 
-    while ((line = mutt_file_read_line(line, &linelen, fpin, &lineno, 0)))
+    while ((line = mutt_file_read_line(line, &linelen, fp_in, &lineno, 0)))
     {
       if (regexec(C_PgpDecryptionOkay->regex, line, 0, NULL, 0) == 0)
       {
@@ -330,7 +330,7 @@ static int pgp_check_pgp_decryption_okay_regex(FILE *fpin)
 
 /**
  * pgp_check_decryption_okay - Check GPG output for status codes
- * @param fpin File to read from
+ * @param fp_in File to read from
  * @retval  1 - no patterns were matched (if delegated to decryption_okay_regex)
  * @retval  0 - DECRYPTION_OKAY was seen, with no PLAINTEXT outside
  * @retval -1 - No decryption status codes were encountered
@@ -348,7 +348,7 @@ static int pgp_check_pgp_decryption_okay_regex(FILE *fpin)
  * "BEGIN PGP MESSAGE" could indicate a signed and armored message.
  * For that we allow -1 and -2 as "valid" (with a warning).
  */
-static int pgp_check_decryption_okay(FILE *fpin)
+static int pgp_check_decryption_okay(FILE *fp_in)
 {
   int rv = -1;
   char *line = NULL, *s = NULL;
@@ -357,9 +357,9 @@ static int pgp_check_decryption_okay(FILE *fpin)
   int inside_decrypt = 0;
 
   if (!C_PgpCheckGpgDecryptStatusFd)
-    return pgp_check_pgp_decryption_okay_regex(fpin);
+    return pgp_check_pgp_decryption_okay_regex(fp_in);
 
-  while ((line = mutt_file_read_line(line, &linelen, fpin, &lineno, 0)))
+  while ((line = mutt_file_read_line(line, &linelen, fp_in, &lineno, 0)))
   {
     size_t plen = mutt_str_startswith(line, "[GNUPG:]", CASE_MATCH);
     if (plen == 0)
@@ -401,7 +401,7 @@ static int pgp_check_decryption_okay(FILE *fpin)
 
 /**
  * pgp_copy_clearsigned - Copy a clearsigned message, stripping the signature
- * @param fpin    File to read from
+ * @param fp_in    File to read from
  * @param s       State to use
  * @param charset Charset of file
  *
@@ -412,19 +412,19 @@ static int pgp_check_decryption_okay(FILE *fpin)
  * (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 neomutt.)
  */
-static void pgp_copy_clearsigned(FILE *fpin, struct State *s, char *charset)
+static void pgp_copy_clearsigned(FILE *fp_in, struct State *s, char *charset)
 {
   char buf[8192];
   bool complete, armor_header;
 
-  rewind(fpin);
+  rewind(fp_in);
 
   /* fromcode comes from the MIME Content-Type charset label. It might
    * be a wrong label, so we want the ability to do corrections via
    * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM.
    */
   struct FgetConv *fc =
-      mutt_ch_fgetconv_open(fpin, charset, C_Charset, MUTT_ICONV_HOOK_FROM);
+      mutt_ch_fgetconv_open(fp_in, charset, C_Charset, MUTT_ICONV_HOOK_FROM);
 
   for (complete = true, armor_header = true;
        mutt_ch_fgetconvs(buf, sizeof(buf), fc); complete = (strchr(buf, '\n')))
@@ -475,8 +475,8 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
   LOFF_T last_pos, offset;
   char buf[8192];
   char tmpfname[PATH_MAX];
-  FILE *pgpout = NULL, *pgpin = NULL, *pgperr = NULL;
-  FILE *tmpfp = NULL;
+  FILE *fp_pgp_out = NULL, *fp_pgp_in = NULL, *fp_pgp_err = NULL;
+  FILE *fp_tmp = NULL;
   pid_t pid;
 
   bool maybe_goodsig = true;
@@ -532,22 +532,22 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
 
       /* Copy PGP material to temporary file */
       mutt_mktemp(tmpfname, sizeof(tmpfname));
-      tmpfp = mutt_file_fopen(tmpfname, "w+");
-      if (!tmpfp)
+      fp_tmp = mutt_file_fopen(tmpfname, "w+");
+      if (!fp_tmp)
       {
         mutt_perror(tmpfname);
         FREE(&gpgcharset);
         return -1;
       }
 
-      fputs(buf, tmpfp);
+      fputs(buf, fp_tmp);
       while (bytes > 0 && fgets(buf, sizeof(buf) - 1, s->fp_in))
       {
         offset = ftello(s->fp_in);
         bytes -= (offset - last_pos); /* don't rely on mutt_str_strlen(buf) */
         last_pos = offset;
 
-        fputs(buf, tmpfp);
+        fputs(buf, fp_tmp);
 
         if ((needpass && (mutt_str_strcmp("-----END PGP MESSAGE-----\n", buf) == 0)) ||
             (!needpass &&
@@ -570,35 +570,35 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
         }
       }
 
-      /* leave tmpfp open in case we still need it - but flush it! */
-      fflush(tmpfp);
+      /* leave fp_tmp open in case we still need it - but flush it! */
+      fflush(fp_tmp);
 
       /* Invoke PGP if needed */
       if (!clearsign || (s->flags & MUTT_VERIFY))
       {
-        pgpout = mutt_file_mkstemp();
-        if (!pgpout)
+        fp_pgp_out = mutt_file_mkstemp();
+        if (!fp_pgp_out)
         {
           mutt_perror(_("Can't create temporary file"));
           rc = -1;
           goto out;
         }
 
-        pgperr = mutt_file_mkstemp();
-        if (!pgperr)
+        fp_pgp_err = mutt_file_mkstemp();
+        if (!fp_pgp_err)
         {
           mutt_perror(_("Can't create temporary file"));
           rc = -1;
           goto out;
         }
 
-        pid = pgp_invoke_decode(&pgpin, NULL, NULL, -1, fileno(pgpout),
-                                fileno(pgperr), tmpfname, (needpass != 0));
+        pid = pgp_invoke_decode(&fp_pgp_in, NULL, NULL, -1, fileno(fp_pgp_out),
+                                fileno(fp_pgp_err), tmpfname, (needpass != 0));
         if (pid == -1)
         {
-          mutt_file_fclose(&pgpout);
+          mutt_file_fclose(&fp_pgp_out);
           maybe_goodsig = false;
-          pgpin = NULL;
+          fp_pgp_in = NULL;
           state_attach_puts(
               _("[-- Error: unable to create PGP subprocess --]\n"), s);
         }
@@ -610,14 +610,14 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
               pgp_class_void_passphrase();
             if (pgp_use_gpg_agent())
               *PgpPass = 0;
-            fprintf(pgpin, "%s\n", PgpPass);
+            fprintf(fp_pgp_in, "%s\n", PgpPass);
           }
 
-          mutt_file_fclose(&pgpin);
+          mutt_file_fclose(&fp_pgp_in);
 
           rv = mutt_wait_filter(pid);
 
-          fflush(pgperr);
+          fflush(fp_pgp_err);
           /* If we are expecting an encrypted message, verify status fd output.
            * Note that BEGIN PGP MESSAGE does not guarantee the content is encrypted,
            * so we need to be more selective about the value of decrypt_okay_rc.
@@ -627,17 +627,17 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
            */
           if (needpass)
           {
-            rewind(pgperr);
-            decrypt_okay_rc = pgp_check_decryption_okay(pgperr);
+            rewind(fp_pgp_err);
+            decrypt_okay_rc = pgp_check_decryption_okay(fp_pgp_err);
             if (decrypt_okay_rc <= -3)
-              mutt_file_fclose(&pgpout);
+              mutt_file_fclose(&fp_pgp_out);
           }
 
           if (s->flags & MUTT_DISPLAY)
           {
-            rewind(pgperr);
+            rewind(fp_pgp_err);
             crypt_current_time(s, "PGP");
-            rc = pgp_copy_checksig(pgperr, s->fp_out);
+            rc = pgp_copy_checksig(fp_pgp_err, s->fp_out);
 
             if (rc == 0)
               have_any_sigs = true;
@@ -657,13 +657,13 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
 
         /* treat empty result as sign of failure */
         /* TODO: maybe on failure neomutt should include the original undecoded text. */
-        if (pgpout)
+        if (fp_pgp_out)
         {
-          rewind(pgpout);
-          c = fgetc(pgpout);
-          ungetc(c, pgpout);
+          rewind(fp_pgp_out);
+          c = fgetc(fp_pgp_out);
+          ungetc(c, fp_pgp_out);
         }
-        if (!clearsign && (!pgpout || c == EOF))
+        if (!clearsign && (!fp_pgp_out || c == EOF))
         {
           could_not_decrypt = true;
           pgp_class_void_passphrase();
@@ -690,11 +690,11 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
 
       if (clearsign)
       {
-        rewind(tmpfp);
-        if (tmpfp)
-          pgp_copy_clearsigned(tmpfp, s, body_charset);
+        rewind(fp_tmp);
+        if (fp_tmp)
+          pgp_copy_clearsigned(fp_tmp, s, body_charset);
       }
-      else if (pgpout)
+      else if (fp_pgp_out)
       {
         struct FgetConv *fc = NULL;
         int ch;
@@ -703,9 +703,9 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
         mutt_debug(LL_DEBUG3, "pgp: recoding inline from [%s] to [%s]\n",
                    expected_charset, C_Charset);
 
-        rewind(pgpout);
+        rewind(fp_pgp_out);
         state_set_prefix(s);
-        fc = mutt_ch_fgetconv_open(pgpout, expected_charset, C_Charset, MUTT_ICONV_HOOK_FROM);
+        fc = mutt_ch_fgetconv_open(fp_pgp_out, expected_charset, C_Charset, MUTT_ICONV_HOOK_FROM);
         while ((ch = mutt_ch_fgetconv(fc)) != EOF)
           state_prefix_putc(ch, s);
         mutt_ch_fgetconv_close(&fc);
@@ -714,10 +714,10 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
       /* Multiple PGP blocks can exist, so these need to be closed and
        * unlinked inside the loop.
        */
-      mutt_file_fclose(&tmpfp);
+      mutt_file_fclose(&fp_tmp);
       mutt_file_unlink(tmpfname);
-      mutt_file_fclose(&pgpout);
-      mutt_file_fclose(&pgperr);
+      mutt_file_fclose(&fp_pgp_out);
+      mutt_file_fclose(&fp_pgp_err);
 
       if (s->flags & MUTT_DISPLAY)
       {
@@ -759,13 +759,13 @@ int pgp_class_application_handler(struct Body *m, struct State *s)
 out:
   m->goodsig = (maybe_goodsig && have_any_sigs);
 
-  if (tmpfp)
+  if (fp_tmp)
   {
-    mutt_file_fclose(&tmpfp);
+    mutt_file_fclose(&fp_tmp);
     mutt_file_unlink(tmpfname);
   }
-  mutt_file_fclose(&pgpout);
-  mutt_file_fclose(&pgperr);
+  mutt_file_fclose(&fp_pgp_out);
+  mutt_file_fclose(&fp_pgp_err);
 
   FREE(&gpgcharset);
 
@@ -790,7 +790,6 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
 {
   char tempfile[PATH_MAX];
   char buf[8192];
-  FILE *tfp = NULL;
 
   bool sgn = false;
   bool enc = false;
@@ -806,14 +805,14 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
     return 0;
   }
 
-  tfp = fopen(tempfile, "r");
-  if (!tfp)
+  FILE *fp_tmp = fopen(tempfile, "r");
+  if (!fp_tmp)
   {
     unlink(tempfile);
     return 0;
   }
 
-  while (fgets(buf, sizeof(buf), tfp))
+  while (fgets(buf, sizeof(buf), fp_tmp))
   {
     size_t plen = mutt_str_startswith(buf, "-----BEGIN PGP ", CASE_MATCH);
     if (plen != 0)
@@ -826,7 +825,7 @@ static int pgp_check_traditional_one_body(FILE *fp, struct Body *b)
         key = true;
     }
   }
-  mutt_file_fclose(&tfp);
+  mutt_file_fclose(&fp_tmp);
   unlink(tempfile);
 
   if (!enc && !sgn && !key)
@@ -878,25 +877,25 @@ int pgp_class_check_traditional(FILE *fp, struct Body *b, bool just_one)
 int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
 {
   char sigfile[PATH_MAX];
-  FILE *pgpout = NULL;
+  FILE *fp_pgp_out = NULL;
   pid_t pid;
   int badsig = -1;
 
   snprintf(sigfile, sizeof(sigfile), "%s.asc", tempfile);
 
-  FILE *fp = mutt_file_fopen(sigfile, "w");
-  if (!fp)
+  FILE *fp_sig = mutt_file_fopen(sigfile, "w");
+  if (!fp_sig)
   {
     mutt_perror(sigfile);
     return -1;
   }
 
   fseeko(s->fp_in, sigbdy->offset, SEEK_SET);
-  mutt_file_copy_bytes(s->fp_in, fp, sigbdy->length);
-  mutt_file_fclose(&fp);
+  mutt_file_copy_bytes(s->fp_in, fp_sig, sigbdy->length);
+  mutt_file_fclose(&fp_sig);
 
-  FILE *pgperr = mutt_file_mkstemp();
-  if (!pgperr)
+  FILE *fp_pgp_err = mutt_file_mkstemp();
+  if (!fp_pgp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     unlink(sigfile);
@@ -905,17 +904,18 @@ int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempf
 
   crypt_current_time(s, "PGP");
 
-  pid = pgp_invoke_verify(NULL, &pgpout, NULL, -1, -1, fileno(pgperr), tempfile, sigfile);
+  pid = pgp_invoke_verify(NULL, &fp_pgp_out, NULL, -1, -1, fileno(fp_pgp_err),
+                          tempfile, sigfile);
   if (pid != -1)
   {
-    if (pgp_copy_checksig(pgpout, s->fp_out) >= 0)
+    if (pgp_copy_checksig(fp_pgp_out, s->fp_out) >= 0)
       badsig = 0;
 
-    mutt_file_fclose(&pgpout);
-    fflush(pgperr);
-    rewind(pgperr);
+    mutt_file_fclose(&fp_pgp_out);
+    fflush(fp_pgp_err);
+    rewind(fp_pgp_err);
 
-    if (pgp_copy_checksig(pgperr, s->fp_out) >= 0)
+    if (pgp_copy_checksig(fp_pgp_err, s->fp_out) >= 0)
       badsig = 0;
 
     const int rv = mutt_wait_filter(pid);
@@ -925,7 +925,7 @@ int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempf
     mutt_debug(LL_DEBUG1, "mutt_wait_filter returned %d.\n", rv);
   }
 
-  mutt_file_fclose(&pgperr);
+  mutt_file_fclose(&fp_pgp_err);
 
   state_attach_puts(_("[-- End of PGP output --]\n\n"), s);
 
@@ -947,19 +947,19 @@ static void pgp_extract_keys_from_attachment(FILE *fp, struct Body *top)
   char tempfname[PATH_MAX];
 
   mutt_mktemp(tempfname, sizeof(tempfname));
-  FILE *tempfp = mutt_file_fopen(tempfname, "w");
-  if (!tempfp)
+  FILE *fp_tmp = mutt_file_fopen(tempfname, "w");
+  if (!fp_tmp)
   {
     mutt_perror(tempfname);
     return;
   }
 
   s.fp_in = fp;
-  s.fp_out = tempfp;
+  s.fp_out = fp_tmp;
 
   mutt_body_handler(top, &s);
 
-  mutt_file_fclose(&tempfp);
+  mutt_file_fclose(&fp_tmp);
 
   pgp_class_invoke_import(tempfname);
   mutt_any_key_to_continue(NULL);
@@ -987,39 +987,39 @@ void pgp_class_extract_key_from_attachment(FILE *fp, struct Body *top)
 
 /**
  * pgp_decrypt_part - Decrypt part of a PGP message
- * @param a     Body of attachment
- * @param s     State to use
- * @param fpout File to write to
- * @param p     Body of parent (main email)
+ * @param a      Body of attachment
+ * @param s      State to use
+ * @param fp_out File to write to
+ * @param p      Body of parent (main email)
  * @retval ptr New Body for the attachment
  */
 static struct Body *pgp_decrypt_part(struct Body *a, struct State *s,
-                                     FILE *fpout, struct Body *p)
+                                     FILE *fp_out, struct Body *p)
 {
-  if (!a || !s || !fpout || !p)
+  if (!a || !s || !fp_out || !p)
     return NULL;
 
   char buf[1024];
-  FILE *pgpin = NULL, *pgpout = NULL, *pgptmp = NULL;
+  FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_tmp = NULL;
   struct stat info;
   struct Body *tattach = NULL;
   char pgptmpfile[PATH_MAX];
   pid_t pid;
   int rv;
 
-  FILE *pgperr = mutt_file_mkstemp();
-  if (!pgperr)
+  FILE *fp_pgp_err = mutt_file_mkstemp();
+  if (!fp_pgp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     return NULL;
   }
 
   mutt_mktemp(pgptmpfile, sizeof(pgptmpfile));
-  pgptmp = mutt_file_fopen(pgptmpfile, "w");
-  if (!pgptmp)
+  fp_pgp_tmp = mutt_file_fopen(pgptmpfile, "w");
+  if (!fp_pgp_tmp)
   {
     mutt_perror(pgptmpfile);
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_pgp_err);
     return NULL;
   }
 
@@ -1028,13 +1028,14 @@ static struct Body *pgp_decrypt_part(struct Body *a, struct State *s,
    */
 
   fseeko(s->fp_in, a->offset, SEEK_SET);
-  mutt_file_copy_bytes(s->fp_in, pgptmp, a->length);
-  mutt_file_fclose(&pgptmp);
+  mutt_file_copy_bytes(s->fp_in, fp_pgp_tmp, a->length);
+  mutt_file_fclose(&fp_pgp_tmp);
 
-  pid = pgp_invoke_decrypt(&pgpin, &pgpout, NULL, -1, -1, fileno(pgperr), pgptmpfile);
+  pid = pgp_invoke_decrypt(&fp_pgp_in, &fp_pgp_out, NULL, -1, -1,
+                           fileno(fp_pgp_err), pgptmpfile);
   if (pid == -1)
   {
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_pgp_err);
     unlink(pgptmpfile);
     if (s->flags & MUTT_DISPLAY)
     {
@@ -1048,70 +1049,70 @@ static struct Body *pgp_decrypt_part(struct Body *a, struct State *s,
      agent is active, because this might lead to a passphrase send as
      the message. */
   if (!pgp_use_gpg_agent())
-    fputs(PgpPass, pgpin);
-  fputc('\n', pgpin);
-  mutt_file_fclose(&pgpin);
+    fputs(PgpPass, fp_pgp_in);
+  fputc('\n', fp_pgp_in);
+  mutt_file_fclose(&fp_pgp_in);
 
   /* Read the output from PGP, and make sure to change CRLF to LF, otherwise
    * read_mime_header has a hard time parsing the message.
    */
-  while (fgets(buf, sizeof(buf) - 1, pgpout))
+  while (fgets(buf, sizeof(buf) - 1, fp_pgp_out))
   {
     size_t len = mutt_str_strlen(buf);
     if (len > 1 && buf[len - 2] == '\r')
       strcpy(buf + len - 2, "\n");
-    fputs(buf, fpout);
+    fputs(buf, fp_out);
   }
 
-  mutt_file_fclose(&pgpout);
+  mutt_file_fclose(&fp_pgp_out);
   rv = mutt_wait_filter(pid);
   mutt_file_unlink(pgptmpfile);
 
-  fflush(pgperr);
-  rewind(pgperr);
-  if (pgp_check_decryption_okay(pgperr) < 0)
+  fflush(fp_pgp_err);
+  rewind(fp_pgp_err);
+  if (pgp_check_decryption_okay(fp_pgp_err) < 0)
   {
     mutt_error(_("Decryption failed"));
     pgp_class_void_passphrase();
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_pgp_err);
     return NULL;
   }
 
   if (s->flags & MUTT_DISPLAY)
   {
-    rewind(pgperr);
-    if (pgp_copy_checksig(pgperr, s->fp_out) == 0 && !rv)
+    rewind(fp_pgp_err);
+    if (pgp_copy_checksig(fp_pgp_err, s->fp_out) == 0 && !rv)
       p->goodsig = true;
     else
       p->goodsig = false;
     state_attach_puts(_("[-- End of PGP output --]\n\n"), s);
   }
-  mutt_file_fclose(&pgperr);
+  mutt_file_fclose(&fp_pgp_err);
 
-  fflush(fpout);
-  rewind(fpout);
+  fflush(fp_out);
+  rewind(fp_out);
 
   if (pgp_use_gpg_agent())
     mutt_need_hard_redraw();
 
-  if (fgetc(fpout) == EOF)
+  if (fgetc(fp_out) == EOF)
   {
     mutt_error(_("Decryption failed"));
     pgp_class_void_passphrase();
     return NULL;
   }
 
-  rewind(fpout);
+  rewind(fp_out);
 
-  tattach = mutt_read_mime_header(fpout, 0);
+  tattach = mutt_read_mime_header(fp_out, 0);
   if (tattach)
   {
     /* Need to set the length of this body part.  */
-    fstat(fileno(fpout), &info);
+    fstat(fileno(fp_out), &info);
     tattach->length = info.st_size - tattach->offset;
 
     /* See if we need to recurse on this MIME part.  */
-    mutt_parse_part(fpout, tattach);
+    mutt_parse_part(fp_out, tattach);
   }
 
   return tattach;
@@ -1120,7 +1121,7 @@ static struct Body *pgp_decrypt_part(struct Body *a, struct State *s,
 /**
  * pgp_class_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
  */
-int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int pgp_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   struct State s = { 0 };
   struct Body *p = b;
@@ -1128,7 +1129,7 @@ int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
   int saved_type = 0;
   LOFF_T saved_offset = 0;
   size_t saved_length = 0;
-  FILE *decoded_fp = NULL;
+  FILE *fp_decoded = NULL;
   int rc = 0;
 
   if (mutt_is_valid_multipart_pgp_encrypted(b))
@@ -1146,7 +1147,7 @@ int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
   else
     return -1;
 
-  s.fp_in = fpin;
+  s.fp_in = fp_in;
 
   if (need_decode)
   {
@@ -1154,38 +1155,38 @@ int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
     saved_offset = b->offset;
     saved_length = b->length;
 
-    decoded_fp = mutt_file_mkstemp();
-    if (!decoded_fp)
+    fp_decoded = mutt_file_mkstemp();
+    if (!fp_decoded)
     {
       mutt_perror(_("Can't create temporary file"));
       return -1;
     }
 
     fseeko(s.fp_in, b->offset, SEEK_SET);
-    s.fp_out = decoded_fp;
+    s.fp_out = fp_decoded;
 
     mutt_decode_attachment(b, &s);
 
-    fflush(decoded_fp);
-    b->length = ftello(decoded_fp);
+    fflush(fp_decoded);
+    b->length = ftello(fp_decoded);
     b->offset = 0;
-    rewind(decoded_fp);
-    s.fp_in = decoded_fp;
+    rewind(fp_decoded);
+    s.fp_in = fp_decoded;
     s.fp_out = 0;
   }
 
-  *fpout = mutt_file_mkstemp();
-  if (!*fpout)
+  *fp_out = mutt_file_mkstemp();
+  if (!*fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     rc = -1;
     goto bail;
   }
 
-  *cur = pgp_decrypt_part(b, &s, *fpout, p);
+  *cur = pgp_decrypt_part(b, &s, *fp_out, p);
   if (!*cur)
     rc = -1;
-  rewind(*fpout);
+  rewind(*fp_out);
 
 bail:
   if (need_decode)
@@ -1193,7 +1194,7 @@ bail:
     b->type = saved_type;
     b->length = saved_length;
     b->offset = saved_offset;
-    mutt_file_fclose(&decoded_fp);
+    mutt_file_fclose(&fp_decoded);
   }
 
   return rc;
@@ -1204,12 +1205,12 @@ bail:
  */
 int pgp_class_encrypted_handler(struct Body *a, struct State *s)
 {
-  FILE *fpin = NULL;
+  FILE *fp_in = NULL;
   struct Body *tattach = NULL;
   int rc = 0;
 
-  FILE *fpout = mutt_file_mkstemp();
-  if (!fpout)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     if (s->flags & MUTT_DISPLAY)
@@ -1220,7 +1221,7 @@ int pgp_class_encrypted_handler(struct Body *a, struct State *s)
   if (s->flags & MUTT_DISPLAY)
     crypt_current_time(s, "PGP");
 
-  tattach = pgp_decrypt_part(a, s, fpout, a);
+  tattach = pgp_decrypt_part(a, s, fp_out, a);
   if (tattach)
   {
     if (s->flags & MUTT_DISPLAY)
@@ -1238,10 +1239,10 @@ int pgp_class_encrypted_handler(struct Body *a, struct State *s)
     a->mime_headers = tattach->mime_headers;
     tattach->mime_headers = NULL;
 
-    fpin = s->fp_in;
-    s->fp_in = fpout;
+    fp_in = s->fp_in;
+    s->fp_in = fp_out;
     rc = mutt_body_handler(tattach, s);
-    s->fp_in = fpin;
+    s->fp_in = fp_in;
 
     /* Embedded multipart signed protected headers override the
      * encrypted headers.  We need to do this after the handler so
@@ -1278,7 +1279,7 @@ int pgp_class_encrypted_handler(struct Body *a, struct State *s)
     rc = -1;
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
 
   return rc;
 }
@@ -1295,7 +1296,7 @@ struct Body *pgp_class_sign_message(struct Body *a)
   struct Body *t = NULL;
   char buf[1024];
   char sigfile[PATH_MAX], signedfile[PATH_MAX];
-  FILE *pgpin = NULL, *pgpout = NULL, *pgperr = NULL, *sfp = NULL;
+  FILE *fp_pgp_in = NULL, *fp_pgp_out = NULL, *fp_pgp_err = NULL, *fp_signed = NULL;
   bool err = false;
   bool empty = true;
   pid_t pid;
@@ -1303,59 +1304,59 @@ struct Body *pgp_class_sign_message(struct Body *a)
   crypt_convert_to_7bit(a); /* Signed data _must_ be in 7-bit format. */
 
   mutt_mktemp(sigfile, sizeof(sigfile));
-  FILE *fp = mutt_file_fopen(sigfile, "w");
-  if (!fp)
+  FILE *fp_sig = mutt_file_fopen(sigfile, "w");
+  if (!fp_sig)
   {
     return NULL;
   }
 
   mutt_mktemp(signedfile, sizeof(signedfile));
-  sfp = mutt_file_fopen(signedfile, "w");
-  if (!sfp)
+  fp_signed = mutt_file_fopen(signedfile, "w");
+  if (!fp_signed)
   {
     mutt_perror(signedfile);
-    mutt_file_fclose(&fp);
+    mutt_file_fclose(&fp_sig);
     unlink(sigfile);
     return NULL;
   }
 
-  mutt_write_mime_header(a, sfp);
-  fputc('\n', sfp);
-  mutt_write_mime_body(a, sfp);
-  mutt_file_fclose(&sfp);
+  mutt_write_mime_header(a, fp_signed);
+  fputc('\n', fp_signed);
+  mutt_write_mime_body(a, fp_signed);
+  mutt_file_fclose(&fp_signed);
 
-  pid = pgp_invoke_sign(&pgpin, &pgpout, &pgperr, -1, -1, -1, signedfile);
+  pid = pgp_invoke_sign(&fp_pgp_in, &fp_pgp_out, &fp_pgp_err, -1, -1, -1, signedfile);
   if (pid == -1)
   {
     mutt_perror(_("Can't open PGP subprocess"));
-    mutt_file_fclose(&fp);
+    mutt_file_fclose(&fp_sig);
     unlink(sigfile);
     unlink(signedfile);
     return NULL;
   }
 
   if (!pgp_use_gpg_agent())
-    fputs(PgpPass, pgpin);
-  fputc('\n', pgpin);
-  mutt_file_fclose(&pgpin);
+    fputs(PgpPass, fp_pgp_in);
+  fputc('\n', fp_pgp_in);
+  mutt_file_fclose(&fp_pgp_in);
 
   /* Read back the PGP signature.  Also, change MESSAGE=>SIGNATURE as
    * recommended for future releases of PGP.
    */
-  while (fgets(buf, sizeof(buf) - 1, pgpout))
+  while (fgets(buf, sizeof(buf) - 1, fp_pgp_out))
   {
     if (mutt_str_strcmp("-----BEGIN PGP MESSAGE-----\n", buf) == 0)
-      fputs("-----BEGIN PGP SIGNATURE-----\n", fp);
+      fputs("-----BEGIN PGP SIGNATURE-----\n", fp_sig);
     else if (mutt_str_strcmp("-----END PGP MESSAGE-----\n", buf) == 0)
-      fputs("-----END PGP SIGNATURE-----\n", fp);
+      fputs("-----END PGP SIGNATURE-----\n", fp_sig);
     else
-      fputs(buf, fp);
+      fputs(buf, fp_sig);
     empty = false; /* got some output, so we're ok */
   }
 
   /* check for errors from PGP */
   err = false;
-  while (fgets(buf, sizeof(buf) - 1, pgperr))
+  while (fgets(buf, sizeof(buf) - 1, fp_pgp_err))
   {
     err = true;
     fputs(buf, stdout);
@@ -1364,11 +1365,11 @@ struct Body *pgp_class_sign_message(struct Body *a)
   if (mutt_wait_filter(pid) && C_PgpCheckExit)
     empty = true;
 
-  mutt_file_fclose(&pgperr);
-  mutt_file_fclose(&pgpout);
+  mutt_file_fclose(&fp_pgp_err);
+  mutt_file_fclose(&fp_pgp_out);
   unlink(signedfile);
 
-  if (fclose(fp) != 0)
+  if (fclose(fp_sig) != 0)
   {
     mutt_perror("fclose");
     unlink(sigfile);
@@ -1543,54 +1544,54 @@ struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign)
   char buf[1024];
   char tempfile[PATH_MAX];
   char pgpinfile[PATH_MAX];
-  FILE *pgpin = NULL, *fptmp = NULL;
+  FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
   struct Body *t = NULL;
   int err = 0;
   int empty = 0;
   pid_t pid;
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *fpout = mutt_file_fopen(tempfile, "w+");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfile, "w+");
+  if (!fp_out)
   {
     mutt_perror(tempfile);
     return NULL;
   }
 
-  FILE *pgperr = mutt_file_mkstemp();
-  if (!pgperr)
+  FILE *fp_pgp_err = mutt_file_mkstemp();
+  if (!fp_pgp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     unlink(tempfile);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_out);
     return NULL;
   }
 
   mutt_mktemp(pgpinfile, sizeof(pgpinfile));
-  fptmp = mutt_file_fopen(pgpinfile, "w");
-  if (!fptmp)
+  fp_tmp = mutt_file_fopen(pgpinfile, "w");
+  if (!fp_tmp)
   {
     mutt_perror(pgpinfile);
     unlink(tempfile);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_pgp_err);
     return NULL;
   }
 
   if (sign)
     crypt_convert_to_7bit(a);
 
-  mutt_write_mime_header(a, fptmp);
-  fputc('\n', fptmp);
-  mutt_write_mime_body(a, fptmp);
-  mutt_file_fclose(&fptmp);
+  mutt_write_mime_header(a, fp_tmp);
+  fputc('\n', fp_tmp);
+  mutt_write_mime_body(a, fp_tmp);
+  mutt_file_fclose(&fp_tmp);
 
-  pid = pgp_invoke_encrypt(&pgpin, NULL, NULL, -1, fileno(fpout),
-                           fileno(pgperr), pgpinfile, keylist, sign);
+  pid = pgp_invoke_encrypt(&fp_pgp_in, NULL, NULL, -1, fileno(fp_out),
+                           fileno(fp_pgp_err), pgpinfile, keylist, sign);
   if (pid == -1)
   {
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_pgp_err);
     unlink(pgpinfile);
     return NULL;
   }
@@ -1598,30 +1599,30 @@ struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign)
   if (sign)
   {
     if (!pgp_use_gpg_agent())
-      fputs(PgpPass, pgpin);
-    fputc('\n', pgpin);
+      fputs(PgpPass, fp_pgp_in);
+    fputc('\n', fp_pgp_in);
   }
-  mutt_file_fclose(&pgpin);
+  mutt_file_fclose(&fp_pgp_in);
 
   if (mutt_wait_filter(pid) && C_PgpCheckExit)
     empty = 1;
 
   unlink(pgpinfile);
 
-  fflush(fpout);
-  rewind(fpout);
+  fflush(fp_out);
+  rewind(fp_out);
   if (!empty)
-    empty = (fgetc(fpout) == EOF);
-  mutt_file_fclose(&fpout);
+    empty = (fgetc(fp_out) == EOF);
+  mutt_file_fclose(&fp_out);
 
-  fflush(pgperr);
-  rewind(pgperr);
-  while (fgets(buf, sizeof(buf) - 1, pgperr))
+  fflush(fp_pgp_err);
+  rewind(fp_pgp_err);
+  while (fgets(buf, sizeof(buf) - 1, fp_pgp_err))
   {
     err = 1;
     fputs(buf, stdout);
   }
-  mutt_file_fclose(&pgperr);
+  mutt_file_fclose(&fp_pgp_err);
 
   /* pause if there is any error output from PGP */
   if (err)
@@ -1678,8 +1679,6 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, SecurityFlags fla
   char *from_charset = NULL;
   const char *send_charset = NULL;
 
-  FILE *fp = NULL;
-
   bool empty = false;
   bool err;
 
@@ -1692,19 +1691,19 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, SecurityFlags fla
   if (mutt_str_strcasecmp(a->subtype, "plain") != 0)
     return NULL;
 
-  fp = fopen(a->filename, "r");
-  if (!fp)
+  FILE *fp_body = fopen(a->filename, "r");
+  if (!fp_body)
   {
     mutt_perror(a->filename);
     return NULL;
   }
 
   mutt_mktemp(pgpinfile, sizeof(pgpinfile));
-  FILE *pgpin = mutt_file_fopen(pgpinfile, "w");
-  if (!pgpin)
+  FILE *fp_pgp_in = mutt_file_fopen(pgpinfile, "w");
+  if (!fp_pgp_in)
   {
     mutt_perror(pgpinfile);
-    mutt_file_fclose(&fp);
+    mutt_file_fclose(&fp_body);
     return NULL;
   }
 
@@ -1731,43 +1730,43 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, SecurityFlags fla
       send_charset = "utf-8";
 
     /* fromcode is assumed to be correct: we set flags to 0 */
-    fc = mutt_ch_fgetconv_open(fp, from_charset, "utf-8", 0);
+    fc = mutt_ch_fgetconv_open(fp_body, from_charset, "utf-8", 0);
     while ((c = mutt_ch_fgetconv(fc)) != EOF)
-      fputc(c, pgpin);
+      fputc(c, fp_pgp_in);
 
     mutt_ch_fgetconv_close(&fc);
   }
   else
   {
     send_charset = "us-ascii";
-    mutt_file_copy_stream(fp, pgpin);
+    mutt_file_copy_stream(fp_body, fp_pgp_in);
   }
-  mutt_file_fclose(&fp);
-  mutt_file_fclose(&pgpin);
+  mutt_file_fclose(&fp_body);
+  mutt_file_fclose(&fp_pgp_in);
 
   mutt_mktemp(pgpoutfile, sizeof(pgpoutfile));
-  FILE *pgpout = mutt_file_fopen(pgpoutfile, "w+");
-  FILE *pgperr = mutt_file_mkstemp();
-  if (!pgpout || !pgperr)
+  FILE *fp_pgp_out = mutt_file_fopen(pgpoutfile, "w+");
+  FILE *fp_pgp_err = mutt_file_mkstemp();
+  if (!fp_pgp_out || !fp_pgp_err)
   {
-    mutt_perror(pgpout ? "Can't create temporary file" : pgpoutfile);
+    mutt_perror(fp_pgp_out ? "Can't create temporary file" : pgpoutfile);
     unlink(pgpinfile);
-    if (pgpout)
+    if (fp_pgp_out)
     {
-      mutt_file_fclose(&pgpout);
+      mutt_file_fclose(&fp_pgp_out);
       unlink(pgpoutfile);
     }
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_pgp_err);
     return NULL;
   }
 
-  pid = pgp_invoke_traditional(&pgpin, NULL, NULL, -1, fileno(pgpout),
-                               fileno(pgperr), pgpinfile, keylist, flags);
+  pid = pgp_invoke_traditional(&fp_pgp_in, NULL, NULL, -1, fileno(fp_pgp_out),
+                               fileno(fp_pgp_err), pgpinfile, keylist, flags);
   if (pid == -1)
   {
     mutt_perror(_("Can't invoke PGP"));
-    mutt_file_fclose(&pgpout);
-    mutt_file_fclose(&pgperr);
+    mutt_file_fclose(&fp_pgp_out);
+    mutt_file_fclose(&fp_pgp_err);
     mutt_file_unlink(pgpinfile);
     unlink(pgpoutfile);
     return NULL;
@@ -1776,33 +1775,33 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, SecurityFlags fla
   if (pgp_use_gpg_agent())
     *PgpPass = 0;
   if (flags & SEC_SIGN)
-    fprintf(pgpin, "%s\n", PgpPass);
-  mutt_file_fclose(&pgpin);
+    fprintf(fp_pgp_in, "%s\n", PgpPass);
+  mutt_file_fclose(&fp_pgp_in);
 
   if (mutt_wait_filter(pid) && C_PgpCheckExit)
     empty = true;
 
   mutt_file_unlink(pgpinfile);
 
-  fflush(pgpout);
-  fflush(pgperr);
+  fflush(fp_pgp_out);
+  fflush(fp_pgp_err);
 
-  rewind(pgpout);
-  rewind(pgperr);
+  rewind(fp_pgp_out);
+  rewind(fp_pgp_err);
 
   if (!empty)
-    empty = (fgetc(pgpout) == EOF);
-  mutt_file_fclose(&pgpout);
+    empty = (fgetc(fp_pgp_out) == EOF);
+  mutt_file_fclose(&fp_pgp_out);
 
   err = false;
 
-  while (fgets(buf, sizeof(buf), pgperr))
+  while (fgets(buf, sizeof(buf), fp_pgp_err))
   {
     err = true;
     fputs(buf, stdout);
   }
 
-  mutt_file_fclose(&pgperr);
+  mutt_file_fclose(&fp_pgp_err);
 
   if (err)
     mutt_any_key_to_continue(NULL);
index d79e825dd56a59d342c33fc24fc2fe0107f8409c..1975e1b1e9f7cc53b54ed8a1391e1f78cf1347b1 100644 (file)
@@ -44,7 +44,7 @@ char *pgp_short_keyid(struct PgpKeyInfo * k);
 char *pgp_long_keyid(struct PgpKeyInfo * k);
 char *pgp_fpr_or_lkeyid(struct PgpKeyInfo * k);
 
-int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+int pgp_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 
 char *pgp_class_find_keys(struct Address *addrlist, bool oppenc_mode);
 
index 35d1fc90e36bbc7b41a3f68b92f4519e70138cec..841153589a3ca06ba8f64864f2eb8d92742168aa 100644 (file)
@@ -189,9 +189,9 @@ static void mutt_pgp_command(char *buf, size_t buflen,
 
 /**
  * pgp_invoke - Run a PGP command
- * @param[out] pgpin           stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout          stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr          stderr for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_in       stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out      stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err      stderr for the command, or NULL (OPTIONAL)
  * @param[in]  pgpinfd         stdin  for the command, or -1 (OPTIONAL)
  * @param[in]  pgpoutfd        stdout for the command, or -1 (OPTIONAL)
  * @param[in]  pgperrfd        stderr for the command, or -1 (OPTIONAL)
@@ -203,11 +203,12 @@ static void mutt_pgp_command(char *buf, size_t buflen,
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd,
-                        int pgperrfd, bool need_passphrase, const char *fname,
+static pid_t pgp_invoke(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                        int pgpinfd, int pgpoutfd, int pgperrfd,
+                        bool need_passphrase, const char *fname,
                         const char *sig_fname, const char *ids, const char *format)
 {
   struct PgpCommandContext cctx = { 0 };
@@ -227,7 +228,8 @@ static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
 
   mutt_pgp_command(cmd, sizeof(cmd), &cctx, format);
 
-  return mutt_create_filter_fd(cmd, pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd);
+  return mutt_create_filter_fd(cmd, fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd,
+                               pgpoutfd, pgperrfd);
 }
 
 /*
@@ -238,9 +240,9 @@ static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
 
 /**
  * pgp_invoke_decode - Use PGP to decode a message
- * @param[out] pgpin           stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout          stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr          stderr for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_in       stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out      stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err      stderr for the command, or NULL (OPTIONAL)
  * @param[in]  pgpinfd         stdin  for the command, or -1 (OPTIONAL)
  * @param[in]  pgpoutfd        stdout for the command, or -1 (OPTIONAL)
  * @param[in]  pgperrfd        stderr for the command, or -1 (OPTIONAL)
@@ -249,147 +251,149 @@ static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_decode(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                        int pgpoutfd, int pgperrfd, const char *fname, bool need_passphrase)
+pid_t pgp_invoke_decode(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                        int pgpinfd, int pgpoutfd, int pgperrfd,
+                        const char *fname, bool need_passphrase)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd, pgperrfd,
                     need_passphrase, fname, NULL, NULL, C_PgpDecodeCommand);
 }
 
 /**
  * pgp_invoke_verify - Use PGP to verify a message
- * @param[out] pgpin     stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout    stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr    stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd   stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd  stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd  stderr for the command, or -1 (OPTIONAL)
- * @param[in]  fname     Filename to pass to the command
- * @param[in]  sig_fname Signature filename to pass to the command
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  fname      Filename to pass to the command
+ * @param[in]  sig_fname  Signature filename to pass to the command
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_verify(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                        int pgpoutfd, int pgperrfd, const char *fname, const char *sig_fname)
+pid_t pgp_invoke_verify(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                        int pgpinfd, int pgpoutfd, int pgperrfd,
+                        const char *fname, const char *sig_fname)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, false,
-                    fname, sig_fname, NULL, C_PgpVerifyCommand);
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                    pgperrfd, false, fname, sig_fname, NULL, C_PgpVerifyCommand);
 }
 
 /**
  * pgp_invoke_decrypt - Use PGP to decrypt a file
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  fname    Filename to pass to the command
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  fname      Filename to pass to the command
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_decrypt(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                         int pgpoutfd, int pgperrfd, const char *fname)
+pid_t pgp_invoke_decrypt(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                         int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, true,
-                    fname, NULL, NULL, C_PgpDecryptCommand);
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                    pgperrfd, true, fname, NULL, NULL, C_PgpDecryptCommand);
 }
 
 /**
  * pgp_invoke_sign - Use PGP to sign a file
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  fname    Filename to pass to the command
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  fname      Filename to pass to the command
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_sign(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                      int pgpoutfd, int pgperrfd, const char *fname)
+pid_t pgp_invoke_sign(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                      int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, true,
-                    fname, NULL, NULL, C_PgpSignCommand);
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                    pgperrfd, true, fname, NULL, NULL, C_PgpSignCommand);
 }
 
 /**
  * pgp_invoke_encrypt - Use PGP to encrypt a file
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  fname    Filename to pass to the command
- * @param[in]  uids     List of IDs/fingerprints, space separated
- * @param[in]  sign     If true, also sign the file
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  fname      Filename to pass to the command
+ * @param[in]  uids       List of IDs/fingerprints, space separated
+ * @param[in]  sign       If true, also sign the file
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_encrypt(FILE **pgpin, FILE **pgpout, FILE **pgperr,
+pid_t pgp_invoke_encrypt(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
                          int pgpinfd, int pgpoutfd, int pgperrfd,
                          const char *fname, const char *uids, bool sign)
 {
   if (sign)
   {
-    return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, true,
-                      fname, NULL, uids, C_PgpEncryptSignCommand);
+    return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                      pgperrfd, true, fname, NULL, uids, C_PgpEncryptSignCommand);
   }
   else
   {
-    return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, false,
-                      fname, NULL, uids, C_PgpEncryptOnlyCommand);
+    return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                      pgperrfd, false, fname, NULL, uids, C_PgpEncryptOnlyCommand);
   }
 }
 
 /**
  * pgp_invoke_traditional - Use PGP to create in inline-signed message
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  fname    Filename to pass to the command
- * @param[in]  uids     List of IDs/fingerprints, space separated
- * @param[in]  flags    Flags, see #SecurityFlags
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  fname      Filename to pass to the command
+ * @param[in]  uids       List of IDs/fingerprints, space separated
+ * @param[in]  flags      Flags, see #SecurityFlags
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_traditional(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                             int pgpoutfd, int pgperrfd, const char *fname,
-                             const char *uids, SecurityFlags flags)
+pid_t pgp_invoke_traditional(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                             int pgpinfd, int pgpoutfd, int pgperrfd,
+                             const char *fname, const char *uids, SecurityFlags flags)
 {
   if (flags & SEC_ENCRYPT)
   {
-    return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
-                      (flags & SEC_SIGN), fname, NULL, uids,
+    return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                      pgperrfd, (flags & SEC_SIGN), fname, NULL, uids,
                       (flags & SEC_SIGN) ? C_PgpEncryptSignCommand : C_PgpEncryptOnlyCommand);
   }
   else
   {
-    return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, true,
-                      fname, NULL, NULL, C_PgpClearsignCommand);
+    return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                      pgperrfd, true, fname, NULL, NULL, C_PgpClearsignCommand);
   }
 }
 
@@ -462,65 +466,65 @@ void pgp_class_invoke_getkeys(struct Address *addr)
 
 /**
  * pgp_invoke_export - Use PGP to export a key from the user's keyring
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  uids     List of IDs/fingerprints, space separated
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  uids       List of IDs/fingerprints, space separated
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_export(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                        int pgpoutfd, int pgperrfd, const char *uids)
+pid_t pgp_invoke_export(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                        int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, false,
-                    NULL, NULL, uids, C_PgpExportCommand);
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                    pgperrfd, false, NULL, NULL, uids, C_PgpExportCommand);
 }
 
 /**
  * pgp_invoke_verify_key - Use PGP to verify a key
- * @param[out] pgpin    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  uids     List of IDs/fingerprints, space separated
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  uids       List of IDs/fingerprints, space separated
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_verify_key(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd,
-                            int pgpoutfd, int pgperrfd, const char *uids)
+pid_t pgp_invoke_verify_key(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
+                            int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids)
 {
-  return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, false,
-                    NULL, NULL, uids, C_PgpVerifyKeyCommand);
+  return pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                    pgperrfd, false, NULL, NULL, uids, C_PgpVerifyKeyCommand);
 }
 
 /**
  * pgp_invoke_list_keys - Find matching PGP Keys
- * @param[out] pgpin  stdin  for the command, or NULL (OPTIONAL)
- * @param[out] pgpout stdout for the command, or NULL (OPTIONAL)
- * @param[out] pgperr stderr for the command, or NULL (OPTIONAL)
- * @param[in]  pgpinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  pgpoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  pgperrfd stderr for the command, or -1 (OPTIONAL)
- * @param[in]  keyring  Keyring type, e.g. #PGP_SECRING
- * @param[in]  hints    Match keys to these strings
+ * @param[out] fp_pgp_in  stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_out stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_pgp_err stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  pgpinfd    stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  pgpoutfd   stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  pgperrfd   stderr for the command, or -1 (OPTIONAL)
+ * @param[in]  keyring    Keyring type, e.g. #PGP_SECRING
+ * @param[in]  hints      Match keys to these strings
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `pgpin` has priority over `pgpinfd`.
- *       Likewise `pgpout` and `pgperr`.
+ * @note `fp_pgp_in` has priority over `pgpinfd`.
+ *       Likewise `fp_pgp_out` and `fp_pgp_err`.
  */
-pid_t pgp_invoke_list_keys(FILE **pgpin, FILE **pgpout, FILE **pgperr,
+pid_t pgp_invoke_list_keys(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err,
                            int pgpinfd, int pgpoutfd, int pgperrfd,
                            enum PgpRing keyring, struct ListHead *hints)
 {
@@ -537,8 +541,8 @@ pid_t pgp_invoke_list_keys(FILE **pgpin, FILE **pgpout, FILE **pgperr,
       mutt_buffer_addch(uids, ' ');
   }
 
-  pid_t rc = pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, 0,
-                        NULL, NULL, mutt_b2s(uids),
+  pid_t rc = pgp_invoke(fp_pgp_in, fp_pgp_out, fp_pgp_err, pgpinfd, pgpoutfd,
+                        pgperrfd, 0, NULL, NULL, mutt_b2s(uids),
                         keyring == PGP_SECRING ? C_PgpListSecringCommand : C_PgpListPubringCommand);
 
   mutt_buffer_pool_release(&uids);
index 1545b590f938e84b55701959271685a811a49b70..5fa47b0e75fbf02638639fe48d7e408df41d4c1a 100644 (file)
@@ -36,14 +36,14 @@ struct ListHead;
 void pgp_class_invoke_import(const char *fname);
 void pgp_class_invoke_getkeys(struct Address *addr);
 
-pid_t pgp_invoke_decode     (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, bool need_passphrase);
-pid_t pgp_invoke_decrypt    (FILE **pgpin, FILE **pgpout, FILE **pgperr, 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, bool sign);
-pid_t pgp_invoke_export     (FILE **pgpin, FILE **pgpout, FILE **pgperr, 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, enum PgpRing keyring, struct ListHead *hints);
-pid_t pgp_invoke_sign       (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname);
-pid_t pgp_invoke_traditional(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *uids, int flags);
-pid_t pgp_invoke_verify     (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *sig_fname);
-pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids);
+pid_t pgp_invoke_decode     (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, bool need_passphrase);
+pid_t pgp_invoke_decrypt    (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname);
+pid_t pgp_invoke_encrypt    (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *uids, bool sign);
+pid_t pgp_invoke_export     (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids);
+pid_t pgp_invoke_list_keys  (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, enum PgpRing keyring, struct ListHead *hints);
+pid_t pgp_invoke_sign       (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname);
+pid_t pgp_invoke_traditional(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *uids, int flags);
+pid_t pgp_invoke_verify     (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *fname, const char *sig_fname);
+pid_t pgp_invoke_verify_key (FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int pgpinfd, int pgpoutfd, int pgperrfd, const char *uids);
 
 #endif /* MUTT_NCRYPT_PGPINVOKE_H */
index 441c6085e2e7bc91d935d193b322b715ce46d559..a34768a226938685e20a82777d453c913cc1aaa6 100644 (file)
@@ -689,16 +689,16 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
       case OP_VERIFY_KEY:
 
         mutt_mktemp(tempfile, sizeof(tempfile));
-        FILE *devnull = fopen("/dev/null", "w");
-        if (!devnull)
+        FILE *fp_null = fopen("/dev/null", "w");
+        if (!fp_null)
         {
           mutt_perror(_("Can't open /dev/null"));
           break;
         }
-        FILE *fp = mutt_file_fopen(tempfile, "w");
-        if (!fp)
+        FILE *fp_tmp = mutt_file_fopen(tempfile, "w");
+        if (!fp_tmp)
         {
-          mutt_file_fclose(&devnull);
+          mutt_file_fclose(&fp_null);
           mutt_perror(_("Can't create temporary file"));
           break;
         }
@@ -708,19 +708,19 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys,
         snprintf(tmpbuf, sizeof(tmpbuf), "0x%s",
                  pgp_fpr_or_lkeyid(pgp_principal_key(key_table[menu->current]->parent)));
 
-        pid_t pid = pgp_invoke_verify_key(NULL, NULL, NULL, -1, fileno(fp),
-                                          fileno(devnull), tmpbuf);
+        pid_t pid = pgp_invoke_verify_key(NULL, NULL, NULL, -1, fileno(fp_tmp),
+                                          fileno(fp_null), tmpbuf);
         if (pid == -1)
         {
           mutt_perror(_("Can't create filter"));
           unlink(tempfile);
-          mutt_file_fclose(&fp);
-          mutt_file_fclose(&devnull);
+          mutt_file_fclose(&fp_tmp);
+          mutt_file_fclose(&fp_null);
         }
 
         mutt_wait_filter(pid);
-        mutt_file_fclose(&fp);
-        mutt_file_fclose(&devnull);
+        mutt_file_fclose(&fp_tmp);
+        mutt_file_fclose(&fp_null);
         mutt_clear_error();
         snprintf(cmd, sizeof(cmd), _("Key ID: 0x%s"),
                  pgp_keyid(pgp_principal_key(key_table[menu->current]->parent)));
@@ -871,8 +871,6 @@ struct Body *pgp_class_make_key_attachment(void)
   struct Body *att = NULL;
   char buf[1024];
   char tempf[PATH_MAX], tmp[256];
-  FILE *tempfp = NULL;
-  FILE *devnull = NULL;
   struct stat sb;
   pid_t pid;
   OptPgpCheckTrust = false;
@@ -888,38 +886,38 @@ struct Body *pgp_class_make_key_attachment(void)
 
   mutt_mktemp(tempf, sizeof(tempf));
 
-  tempfp = mutt_file_fopen(tempf, "w");
-  if (!tempfp)
+  FILE *fp_tmp = mutt_file_fopen(tempf, "w");
+  if (!fp_tmp)
   {
     mutt_perror(_("Can't create temporary file"));
     return NULL;
   }
 
-  devnull = fopen("/dev/null", "w");
-  if (!devnull)
+  FILE *fp_null = fopen("/dev/null", "w");
+  if (!fp_null)
   {
     mutt_perror(_("Can't open /dev/null"));
-    mutt_file_fclose(&tempfp);
+    mutt_file_fclose(&fp_tmp);
     unlink(tempf);
     return NULL;
   }
 
   mutt_message(_("Invoking PGP..."));
 
-  pid = pgp_invoke_export(NULL, NULL, NULL, -1, fileno(tempfp), fileno(devnull), tmp);
+  pid = pgp_invoke_export(NULL, NULL, NULL, -1, fileno(fp_tmp), fileno(fp_null), tmp);
   if (pid == -1)
   {
     mutt_perror(_("Can't create filter"));
     unlink(tempf);
-    mutt_file_fclose(&tempfp);
-    mutt_file_fclose(&devnull);
+    mutt_file_fclose(&fp_tmp);
+    mutt_file_fclose(&fp_null);
     return NULL;
   }
 
   mutt_wait_filter(pid);
 
-  mutt_file_fclose(&tempfp);
-  mutt_file_fclose(&devnull);
+  mutt_file_fclose(&fp_tmp);
+  mutt_file_fclose(&fp_null);
 
   att = mutt_body_new();
   att->filename = mutt_str_strdup(tempf);
index 16025b30711666e91ba9681a9bf303be20085841..ebfd145a6da6af8445c9daac904f7a2c29b6a412 100644 (file)
@@ -62,10 +62,10 @@ static const char *pgp_hash_to_micalg(short id)
 
 /**
  * pgp_dearmor - Unwrap an armoured PGP block
- * @param in  File to read from
- * @param out File to write to
+ * @param fp_in  File to read from
+ * @param fp_out File to write to
  */
-static void pgp_dearmor(FILE *in, FILE *out)
+static void pgp_dearmor(FILE *fp_in, FILE *fp_out)
 {
   char line[8192];
   LOFF_T start;
@@ -73,12 +73,12 @@ static void pgp_dearmor(FILE *in, FILE *out)
   char *r = NULL;
 
   struct State state = { 0 };
-  state.fp_in = in;
-  state.fp_out = out;
+  state.fp_in = fp_in;
+  state.fp_out = fp_out;
 
   /* find the beginning of ASCII armor */
 
-  while ((r = fgets(line, sizeof(line), in)))
+  while ((r = fgets(line, sizeof(line), fp_in)))
   {
     if (strncmp(line, "-----BEGIN", 10) == 0)
       break;
@@ -91,7 +91,7 @@ static void pgp_dearmor(FILE *in, FILE *out)
 
   /* skip the armor header */
 
-  while ((r = fgets(line, sizeof(line), in)))
+  while ((r = fgets(line, sizeof(line), fp_in)))
   {
     SKIPWS(r);
     if (!*r)
@@ -104,13 +104,13 @@ static void pgp_dearmor(FILE *in, FILE *out)
   }
 
   /* actual data starts here */
-  start = ftello(in);
+  start = ftello(fp_in);
   if (start < 0)
     return;
 
   /* find the checksum */
 
-  while ((r = fgets(line, sizeof(line), in)))
+  while ((r = fgets(line, sizeof(line), fp_in)))
   {
     if (*line == '=' || (strncmp(line, "-----END", 8) == 0))
       break;
@@ -121,14 +121,14 @@ static void pgp_dearmor(FILE *in, FILE *out)
     return;
   }
 
-  end = ftello(in) - strlen(line);
+  end = ftello(fp_in) - strlen(line);
   if (end < start)
   {
     mutt_debug(LL_DEBUG1, "end < start???\n");
     return;
   }
 
-  if (fseeko(in, start, SEEK_SET) == -1)
+  if (fseeko(fp_in, start, SEEK_SET) == -1)
   {
     mutt_debug(LL_DEBUG1, "Can't seekto start.\n");
     return;
@@ -179,24 +179,24 @@ static short pgp_find_hash(const char *fname)
   size_t l;
   short rc = -1;
 
-  FILE *out = mutt_file_mkstemp();
-  if (!out)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     goto bye;
   }
 
-  FILE *in = fopen(fname, "r");
-  if (!in)
+  FILE *fp_in = fopen(fname, "r");
+  if (!fp_in)
   {
     mutt_perror(fname);
     goto bye;
   }
 
-  pgp_dearmor(in, out);
-  rewind(out);
+  pgp_dearmor(fp_in, fp_out);
+  rewind(fp_out);
 
-  unsigned char *p = pgp_read_packet(out, &l);
+  unsigned char *p = pgp_read_packet(fp_out, &l);
   if (p)
   {
     rc = pgp_mic_from_packet(p, l);
@@ -208,8 +208,8 @@ static short pgp_find_hash(const char *fname)
 
 bye:
 
-  mutt_file_fclose(&in);
-  mutt_file_fclose(&out);
+  mutt_file_fclose(&fp_in);
+  mutt_file_fclose(&fp_out);
   pgp_release_packet();
   return rc;
 }
index fd6dc6604c6129842717bdd920a1adc4fa49de71..1b6ba0dcf502b1845819b6bff4d2dad05904c755 100644 (file)
@@ -103,7 +103,7 @@ time_t SmimeExptime = 0; /* when does the cached passphrase expire? */
 
 static char SmimeKeyToUse[PATH_MAX] = { 0 };
 static char SmimeCertToUse[PATH_MAX];
-static char SmimeIntermediateToUse[PATH_MAX];
+static char fp_smime_intermediateToUse[PATH_MAX];
 
 /**
  * smime_free_key - Free a list of SMIME keys
@@ -359,12 +359,12 @@ static void smime_command(char *buf, size_t buflen,
 
 /**
  * smime_invoke - Run an SMIME command
- * @param[out] smimein       stdin  for the command, or NULL (OPTIONAL)
- * @param[out] smimeout      stdout for the command, or NULL (OPTIONAL)
- * @param[out] smimeerr      stderr for the command, or NULL (OPTIONAL)
- * @param[in]  smimeinfd     stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  smimeoutfd    stdout for the command, or -1 (OPTIONAL)
- * @param[in]  smimeerrfd    stderr for the command, or -1 (OPTIONAL)
+ * @param[out] fp_smime_in       stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_out      stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_err      stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  fp_smime_infd     stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_outfd    stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_errfd    stderr for the command, or -1 (OPTIONAL)
  * @param[in]  fname         Filename to pass to the command
  * @param[in]  sig_fname     Signature filename to pass to the command
  * @param[in]  cryptalg      Encryption algorithm
@@ -376,11 +376,11 @@ static void smime_command(char *buf, size_t buflen,
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `smimein` has priority over `smimeinfd`.
- *       Likewise `smimeout` and `smimeerr`.
+ * @note `fp_smime_in` has priority over `fp_smime_infd`.
+ *       Likewise `fp_smime_out` and `fp_smime_err`.
  */
-static pid_t smime_invoke(FILE **smimein, FILE **smimeout, FILE **smimeerr,
-                          int smimeinfd, int smimeoutfd, int smimeerrfd,
+static pid_t smime_invoke(FILE **fp_smime_in, FILE **fp_smime_out, FILE **fp_smime_err,
+                          int fp_smime_infd, int fp_smime_outfd, int fp_smime_errfd,
                           const char *fname, const char *sig_fname, const char *cryptalg,
                           const char *digestalg, const char *key, const char *certificates,
                           const char *intermediates, const char *format)
@@ -401,8 +401,8 @@ static pid_t smime_invoke(FILE **smimein, FILE **smimeout, FILE **smimeerr,
 
   smime_command(cmd, sizeof(cmd), &cctx, format);
 
-  return mutt_create_filter_fd(cmd, smimein, smimeout, smimeerr, smimeinfd,
-                               smimeoutfd, smimeerrfd);
+  return mutt_create_filter_fd(cmd, fp_smime_in, fp_smime_out, fp_smime_err,
+                               fp_smime_infd, fp_smime_outfd, fp_smime_errfd);
 }
 
 /*
@@ -1099,39 +1099,39 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
   pid_t pid;
   size_t len = 0;
 
-  FILE *fperr = mutt_file_mkstemp();
-  if (!fperr)
+  FILE *fp_err = mutt_file_mkstemp();
+  if (!fp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     return 1;
   }
 
-  FILE *fpout = mutt_file_mkstemp();
-  if (!fpout)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_err);
     mutt_perror(_("Can't create temporary file"));
     return 1;
   }
 
-  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fpout), fileno(fperr), certificate,
+  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fp_out), fileno(fp_err), certificate,
                      NULL, NULL, NULL, NULL, NULL, NULL, C_SmimeGetCertEmailCommand);
   if (pid == -1)
   {
     mutt_message(_("Error: unable to create OpenSSL subprocess"));
-    mutt_file_fclose(&fperr);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_err);
+    mutt_file_fclose(&fp_out);
     return 1;
   }
 
   mutt_wait_filter(pid);
 
-  fflush(fpout);
-  rewind(fpout);
-  fflush(fperr);
-  rewind(fperr);
+  fflush(fp_out);
+  rewind(fp_out);
+  fflush(fp_err);
+  rewind(fp_err);
 
-  while ((fgets(email, sizeof(email), fpout)))
+  while ((fgets(email, sizeof(email), fp_out)))
   {
     len = mutt_str_strlen(email);
     if (len && (email[len - 1] == '\n'))
@@ -1146,7 +1146,7 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
   if (rc == -1)
   {
     mutt_endwin();
-    mutt_file_copy_stream(fperr, stdout);
+    mutt_file_copy_stream(fp_err, stdout);
     mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess"));
     rc = 1;
   }
@@ -1161,8 +1161,8 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
     *buffer = mutt_mem_calloc(count, sizeof(char *));
     count = 0;
 
-    rewind(fpout);
-    while ((fgets(email, sizeof(email), fpout)))
+    rewind(fp_out);
+    while ((fgets(email, sizeof(email), fp_out)))
     {
       len = mutt_str_strlen(email);
       if (len && (email[len - 1] == '\n'))
@@ -1175,8 +1175,8 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
   else if (copy)
     rc = 2;
 
-  mutt_file_fclose(&fpout);
-  mutt_file_fclose(&fperr);
+  mutt_file_fclose(&fp_out);
+  mutt_file_fclose(&fp_err);
 
   return rc;
 }
@@ -1192,18 +1192,18 @@ static char *smime_extract_certificate(char *infile)
   pid_t pid;
   int empty;
 
-  FILE *fperr = mutt_file_mkstemp();
-  if (!fperr)
+  FILE *fp_err = mutt_file_mkstemp();
+  if (!fp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     return NULL;
   }
 
   mutt_mktemp(pk7out, sizeof(pk7out));
-  FILE *fpout = mutt_file_fopen(pk7out, "w+");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(pk7out, "w+");
+  if (!fp_out)
   {
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_err);
     mutt_perror(pk7out);
     return NULL;
   }
@@ -1211,40 +1211,40 @@ static char *smime_extract_certificate(char *infile)
   /* Step 1: Convert the signature to a PKCS#7 structure, as we can't
      extract the full set of certificates directly.
   */
-  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fpout), fileno(fperr), infile,
+  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fp_out), fileno(fp_err), infile,
                      NULL, NULL, NULL, NULL, NULL, NULL, C_SmimePk7outCommand);
   if (pid == -1)
   {
     mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess"));
-    mutt_file_fclose(&fperr);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_err);
+    mutt_file_fclose(&fp_out);
     mutt_file_unlink(pk7out);
     return NULL;
   }
 
   mutt_wait_filter(pid);
 
-  fflush(fpout);
-  rewind(fpout);
-  fflush(fperr);
-  rewind(fperr);
-  empty = (fgetc(fpout) == EOF);
+  fflush(fp_out);
+  rewind(fp_out);
+  fflush(fp_err);
+  rewind(fp_err);
+  empty = (fgetc(fp_out) == EOF);
   if (empty)
   {
     mutt_perror(pk7out);
-    mutt_file_copy_stream(fperr, stdout);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&fperr);
+    mutt_file_copy_stream(fp_err, stdout);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_err);
     mutt_file_unlink(pk7out);
     return NULL;
   }
 
-  mutt_file_fclose(&fpout);
+  mutt_file_fclose(&fp_out);
   mutt_mktemp(certfile, sizeof(certfile));
-  fpout = mutt_file_fopen(certfile, "w+");
-  if (!fpout)
+  fp_out = mutt_file_fopen(certfile, "w+");
+  if (!fp_out)
   {
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_err);
     mutt_file_unlink(pk7out);
     mutt_perror(certfile);
     return NULL;
@@ -1252,13 +1252,13 @@ static char *smime_extract_certificate(char *infile)
 
   /* Step 2: Extract the certificates from a PKCS#7 structure.
    */
-  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fpout), fileno(fperr), pk7out,
+  pid = smime_invoke(NULL, NULL, NULL, -1, fileno(fp_out), fileno(fp_err), pk7out,
                      NULL, NULL, NULL, NULL, NULL, NULL, C_SmimeGetCertCommand);
   if (pid == -1)
   {
     mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess"));
-    mutt_file_fclose(&fperr);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_err);
+    mutt_file_fclose(&fp_out);
     mutt_file_unlink(pk7out);
     mutt_file_unlink(certfile);
     return NULL;
@@ -1268,22 +1268,22 @@ static char *smime_extract_certificate(char *infile)
 
   mutt_file_unlink(pk7out);
 
-  fflush(fpout);
-  rewind(fpout);
-  fflush(fperr);
-  rewind(fperr);
-  empty = (fgetc(fpout) == EOF);
+  fflush(fp_out);
+  rewind(fp_out);
+  fflush(fp_err);
+  rewind(fp_err);
+  empty = (fgetc(fp_out) == EOF);
   if (empty)
   {
-    mutt_file_copy_stream(fperr, stdout);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&fperr);
+    mutt_file_copy_stream(fp_err, stdout);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_err);
     mutt_file_unlink(certfile);
     return NULL;
   }
 
-  mutt_file_fclose(&fpout);
-  mutt_file_fclose(&fperr);
+  mutt_file_fclose(&fp_out);
+  mutt_file_fclose(&fp_err);
 
   return mutt_str_strdup(certfile);
 }
@@ -1299,55 +1299,55 @@ static char *smime_extract_signer_certificate(char *infile)
   pid_t pid;
   int empty;
 
-  FILE *fperr = mutt_file_mkstemp();
-  if (!fperr)
+  FILE *fp_err = mutt_file_mkstemp();
+  if (!fp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     return NULL;
   }
 
   mutt_mktemp(certfile, sizeof(certfile));
-  FILE *fpout = mutt_file_fopen(certfile, "w+");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(certfile, "w+");
+  if (!fp_out)
   {
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_err);
     mutt_perror(certfile);
     return NULL;
   }
 
   /* Extract signer's certificate
    */
-  pid = smime_invoke(NULL, NULL, NULL, -1, -1, fileno(fperr), infile, NULL, NULL,
+  pid = smime_invoke(NULL, NULL, NULL, -1, -1, fileno(fp_err), infile, NULL, NULL,
                      NULL, NULL, certfile, NULL, C_SmimeGetSignerCertCommand);
   if (pid == -1)
   {
     mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess"));
-    mutt_file_fclose(&fperr);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_err);
+    mutt_file_fclose(&fp_out);
     mutt_file_unlink(certfile);
     return NULL;
   }
 
   mutt_wait_filter(pid);
 
-  fflush(fpout);
-  rewind(fpout);
-  fflush(fperr);
-  rewind(fperr);
-  empty = (fgetc(fpout) == EOF);
+  fflush(fp_out);
+  rewind(fp_out);
+  fflush(fp_err);
+  rewind(fp_err);
+  empty = (fgetc(fp_out) == EOF);
   if (empty)
   {
     mutt_endwin();
-    mutt_file_copy_stream(fperr, stdout);
+    mutt_file_copy_stream(fp_err, stdout);
     mutt_any_key_to_continue(NULL);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_err);
     mutt_file_unlink(certfile);
     return NULL;
   }
 
-  mutt_file_fclose(&fpout);
-  mutt_file_fclose(&fperr);
+  mutt_file_fclose(&fp_out);
+  mutt_file_fclose(&fp_err);
 
   return mutt_str_strdup(certfile);
 }
@@ -1358,19 +1358,19 @@ static char *smime_extract_signer_certificate(char *infile)
 void smime_class_invoke_import(char *infile, char *mailbox)
 {
   char *certfile = NULL, buf[256];
-  FILE *smimein = NULL;
+  FILE *fp_smime_in = NULL;
 
-  FILE *fperr = mutt_file_mkstemp();
-  if (!fperr)
+  FILE *fp_err = mutt_file_mkstemp();
+  if (!fp_err)
   {
     mutt_perror(_("Can't create temporary file"));
     return;
   }
 
-  FILE *fpout = mutt_file_mkstemp();
-  if (!fpout)
+  FILE *fp_out = mutt_file_mkstemp();
+  if (!fp_out)
   {
-    mutt_file_fclose(&fperr);
+    mutt_file_fclose(&fp_err);
     mutt_perror(_("Can't create temporary file"));
     return;
   }
@@ -1381,8 +1381,8 @@ void smime_class_invoke_import(char *infile, char *mailbox)
     if ((mutt_get_field(_("Label for certificate: "), buf, sizeof(buf), 0) != 0) ||
         (buf[0] == 0))
     {
-      mutt_file_fclose(&fpout);
-      mutt_file_fclose(&fperr);
+      mutt_file_fclose(&fp_out);
+      mutt_file_fclose(&fp_err);
       return;
     }
   }
@@ -1393,17 +1393,17 @@ void smime_class_invoke_import(char *infile, char *mailbox)
   {
     mutt_endwin();
 
-    pid_t pid = smime_invoke(&smimein, NULL, NULL, -1, fileno(fpout),
-                             fileno(fperr), certfile, NULL, NULL, NULL, NULL,
+    pid_t pid = smime_invoke(&fp_smime_in, NULL, NULL, -1, fileno(fp_out),
+                             fileno(fp_err), certfile, NULL, NULL, NULL, NULL,
                              NULL, NULL, C_SmimeImportCertCommand);
     if (pid == -1)
     {
       mutt_message(_("Error: unable to create OpenSSL subprocess"));
       return;
     }
-    fputs(buf, smimein);
-    fputc('\n', smimein);
-    mutt_file_fclose(&smimein);
+    fputs(buf, fp_smime_in);
+    fputc('\n', fp_smime_in);
+    mutt_file_fclose(&fp_smime_in);
 
     mutt_wait_filter(pid);
 
@@ -1411,16 +1411,16 @@ void smime_class_invoke_import(char *infile, char *mailbox)
     FREE(&certfile);
   }
 
-  fflush(fpout);
-  rewind(fpout);
-  fflush(fperr);
-  rewind(fperr);
+  fflush(fp_out);
+  rewind(fp_out);
+  fflush(fp_err);
+  rewind(fp_err);
 
-  mutt_file_copy_stream(fpout, stdout);
-  mutt_file_copy_stream(fperr, stdout);
+  mutt_file_copy_stream(fp_out, stdout);
+  mutt_file_copy_stream(fp_err, stdout);
 
-  mutt_file_fclose(&fpout);
-  mutt_file_fclose(&fperr);
+  mutt_file_fclose(&fp_out);
+  mutt_file_fclose(&fp_err);
 }
 
 /**
@@ -1432,8 +1432,8 @@ int smime_class_verify_sender(struct Email *e)
   int retval = 1;
 
   mutt_mktemp(tempfname, sizeof(tempfname));
-  FILE *fpout = mutt_file_fopen(tempfname, "w");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfname, "w");
+  if (!fp_out)
   {
     mutt_perror(tempfname);
     return 1;
@@ -1441,14 +1441,14 @@ int smime_class_verify_sender(struct Email *e)
 
   if (e->security & SEC_ENCRYPT)
   {
-    mutt_copy_message_ctx(fpout, Context->mailbox, e, MUTT_CM_DECODE_CRYPT & MUTT_CM_DECODE_SMIME,
+    mutt_copy_message_ctx(fp_out, Context->mailbox, e, MUTT_CM_DECODE_CRYPT & MUTT_CM_DECODE_SMIME,
                           CH_MIME | CH_WEED | CH_NONEWLINE);
   }
   else
-    mutt_copy_message_ctx(fpout, Context->mailbox, e, 0, 0);
+    mutt_copy_message_ctx(fp_out, Context->mailbox, e, 0, 0);
 
-  fflush(fpout);
-  mutt_file_fclose(&fpout);
+  fflush(fp_out);
+  mutt_file_fclose(&fp_out);
 
   if (e->env->from)
   {
@@ -1493,50 +1493,53 @@ int smime_class_verify_sender(struct Email *e)
 
 /**
  * smime_invoke_encrypt - Use SMIME to encrypt a file
- * @param[out] smimein    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] smimeout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] smimeerr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  smimeinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  smimeoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  smimeerrfd stderr for the command, or -1 (OPTIONAL)
+ * @param[out] fp_smime_in    stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_out   stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_err   stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  fp_smime_infd  stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_outfd stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_errfd stderr for the command, or -1 (OPTIONAL)
  * @param[in]  fname      Filename to pass to the command
  * @param[in]  uids       List of IDs/fingerprints, space separated
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `smimein` has priority over `smimeinfd`.
- *       Likewise `smimeout` and `smimeerr`.
+ * @note `fp_smime_in` has priority over `fp_smime_infd`.
+ *       Likewise `fp_smime_out` and `fp_smime_err`.
  */
-static pid_t smime_invoke_encrypt(FILE **smimein, FILE **smimeout, FILE **smimeerr,
-                                  int smimeinfd, int smimeoutfd, int smimeerrfd,
+static pid_t smime_invoke_encrypt(FILE **fp_smime_in, FILE **fp_smime_out,
+                                  FILE **fp_smime_err, int fp_smime_infd,
+                                  int fp_smime_outfd, int fp_smime_errfd,
                                   const char *fname, const char *uids)
 {
-  return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd,
-                      smimeerrfd, fname, NULL, C_SmimeEncryptWith, NULL, NULL,
-                      uids, NULL, C_SmimeEncryptCommand);
+  return smime_invoke(fp_smime_in, fp_smime_out, fp_smime_err, fp_smime_infd,
+                      fp_smime_outfd, fp_smime_errfd, fname, NULL, C_SmimeEncryptWith,
+                      NULL, NULL, uids, NULL, C_SmimeEncryptCommand);
 }
 
 /**
  * smime_invoke_sign - Use SMIME to sign a file
- * @param[out] smimein    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] smimeout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] smimeerr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  smimeinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  smimeoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  smimeerrfd stderr for the command, or -1 (OPTIONAL)
+ * @param[out] fp_smime_in    stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_out   stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_err   stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  fp_smime_infd  stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_outfd stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_errfd stderr for the command, or -1 (OPTIONAL)
  * @param[in]  fname      Filename to pass to the command
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `smimein` has priority over `smimeinfd`.
- *       Likewise `smimeout` and `smimeerr`.
+ * @note `fp_smime_in` has priority over `fp_smime_infd`.
+ *       Likewise `fp_smime_out` and `fp_smime_err`.
  */
-static pid_t smime_invoke_sign(FILE **smimein, FILE **smimeout, FILE **smimeerr, int smimeinfd,
-                               int smimeoutfd, int smimeerrfd, const char *fname)
+static pid_t smime_invoke_sign(FILE **fp_smime_in, FILE **fp_smime_out,
+                               FILE **fp_smime_err, int fp_smime_infd, int fp_smime_outfd,
+                               int fp_smime_errfd, const char *fname)
 {
-  return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd, smimeerrfd,
-                      fname, NULL, NULL, C_SmimeSignDigestAlg, SmimeKeyToUse,
-                      SmimeCertToUse, SmimeIntermediateToUse, C_SmimeSignCommand);
+  return smime_invoke(fp_smime_in, fp_smime_out, fp_smime_err, fp_smime_infd,
+                      fp_smime_outfd, fp_smime_errfd, fname, NULL, NULL,
+                      C_SmimeSignDigestAlg, SmimeKeyToUse, SmimeCertToUse,
+                      fp_smime_intermediateToUse, C_SmimeSignCommand);
 }
 
 /**
@@ -1546,37 +1549,37 @@ struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist)
 {
   char buf[1024], certfile[PATH_MAX];
   char tempfile[PATH_MAX];
-  char smimeinfile[PATH_MAX];
+  char fp_smime_infile[PATH_MAX];
   char *cert_end = NULL;
-  FILE *smimein = NULL;
+  FILE *fp_smime_in = NULL;
   int err = 0, empty, off;
   pid_t pid;
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *fpout = mutt_file_fopen(tempfile, "w+");
-  if (!fpout)
+  FILE *fp_out = mutt_file_fopen(tempfile, "w+");
+  if (!fp_out)
   {
     mutt_perror(tempfile);
     return NULL;
   }
 
-  FILE *smimeerr = mutt_file_mkstemp();
-  if (!smimeerr)
+  FILE *fp_smime_err = mutt_file_mkstemp();
+  if (!fp_smime_err)
   {
     mutt_perror(_("Can't create temporary file"));
     mutt_file_unlink(tempfile);
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_out);
     return NULL;
   }
 
-  mutt_mktemp(smimeinfile, sizeof(smimeinfile));
-  FILE *fptmp = mutt_file_fopen(smimeinfile, "w+");
-  if (!fptmp)
+  mutt_mktemp(fp_smime_infile, sizeof(fp_smime_infile));
+  FILE *fp_tmp = mutt_file_fopen(fp_smime_infile, "w+");
+  if (!fp_tmp)
   {
-    mutt_perror(smimeinfile);
+    mutt_perror(fp_smime_infile);
     mutt_file_unlink(tempfile);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&smimeerr);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_smime_err);
     return NULL;
   }
 
@@ -1597,40 +1600,40 @@ struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist)
   }
 
   /* write a MIME entity */
-  mutt_write_mime_header(a, fptmp);
-  fputc('\n', fptmp);
-  mutt_write_mime_body(a, fptmp);
-  mutt_file_fclose(&fptmp);
+  mutt_write_mime_header(a, fp_tmp);
+  fputc('\n', fp_tmp);
+  mutt_write_mime_body(a, fp_tmp);
+  mutt_file_fclose(&fp_tmp);
 
-  pid = smime_invoke_encrypt(&smimein, NULL, NULL, -1, fileno(fpout),
-                             fileno(smimeerr), smimeinfile, certfile);
+  pid = smime_invoke_encrypt(&fp_smime_in, NULL, NULL, -1, fileno(fp_out),
+                             fileno(fp_smime_err), fp_smime_infile, certfile);
   if (pid == -1)
   {
     mutt_file_unlink(tempfile);
-    mutt_file_fclose(&fpout);
-    mutt_file_fclose(&smimeerr);
-    mutt_file_unlink(smimeinfile);
+    mutt_file_fclose(&fp_out);
+    mutt_file_fclose(&fp_smime_err);
+    mutt_file_unlink(fp_smime_infile);
     return NULL;
   }
 
-  mutt_file_fclose(&smimein);
+  mutt_file_fclose(&fp_smime_in);
 
   mutt_wait_filter(pid);
-  mutt_file_unlink(smimeinfile);
+  mutt_file_unlink(fp_smime_infile);
 
-  fflush(fpout);
-  rewind(fpout);
-  empty = (fgetc(fpout) == EOF);
-  mutt_file_fclose(&fpout);
+  fflush(fp_out);
+  rewind(fp_out);
+  empty = (fgetc(fp_out) == EOF);
+  mutt_file_fclose(&fp_out);
 
-  fflush(smimeerr);
-  rewind(smimeerr);
-  while (fgets(buf, sizeof(buf) - 1, smimeerr))
+  fflush(fp_smime_err);
+  rewind(fp_smime_err);
+  while (fgets(buf, sizeof(buf) - 1, fp_smime_err))
   {
     err = 1;
     fputs(buf, stdout);
   }
-  mutt_file_fclose(&smimeerr);
+  mutt_file_fclose(&fp_smime_err);
 
   /* pause if there is any error output from SMIME */
   if (err)
@@ -1701,7 +1704,7 @@ struct Body *smime_class_sign_message(struct Body *a)
 {
   char buf[1024];
   char signedfile[PATH_MAX], filetosign[PATH_MAX];
-  FILE *smimein = NULL, *smimeout = NULL, *smimeerr = NULL, *sfp = NULL;
+  FILE *fp_smime_in = NULL, *fp_smime_out = NULL, *fp_smime_err = NULL, *fp_sign = NULL;
   int err = 0;
   int empty = 0;
   pid_t pid;
@@ -1717,27 +1720,27 @@ struct Body *smime_class_sign_message(struct Body *a)
   crypt_convert_to_7bit(a); /* Signed data _must_ be in 7-bit format. */
 
   mutt_mktemp(filetosign, sizeof(filetosign));
-  sfp = mutt_file_fopen(filetosign, "w+");
-  if (!sfp)
+  fp_sign = mutt_file_fopen(filetosign, "w+");
+  if (!fp_sign)
   {
     mutt_perror(filetosign);
     return NULL;
   }
 
   mutt_mktemp(signedfile, sizeof(signedfile));
-  smimeout = mutt_file_fopen(signedfile, "w+");
-  if (!smimeout)
+  fp_smime_out = mutt_file_fopen(signedfile, "w+");
+  if (!fp_smime_out)
   {
     mutt_perror(signedfile);
-    mutt_file_fclose(&sfp);
+    mutt_file_fclose(&fp_sign);
     mutt_file_unlink(filetosign);
     return NULL;
   }
 
-  mutt_write_mime_header(a, sfp);
-  fputc('\n', sfp);
-  mutt_write_mime_body(a, sfp);
-  mutt_file_fclose(&sfp);
+  mutt_write_mime_header(a, fp_sign);
+  fputc('\n', fp_sign);
+  mutt_write_mime_body(a, fp_sign);
+  mutt_file_fclose(&fp_sign);
 
   snprintf(SmimeKeyToUse, sizeof(SmimeKeyToUse), "%s/%s", NONULL(C_SmimeKeys), signas);
 
@@ -1750,41 +1753,42 @@ struct Body *smime_class_sign_message(struct Body *a)
   else
     intermediates = signas_key->issuer;
 
-  snprintf(SmimeIntermediateToUse, sizeof(SmimeIntermediateToUse), "%s/%s",
-           NONULL(C_SmimeCertificates), intermediates);
+  snprintf(fp_smime_intermediateToUse, sizeof(fp_smime_intermediateToUse),
+           "%s/%s", NONULL(C_SmimeCertificates), intermediates);
 
   smime_free_key(&signas_key);
 
-  pid = smime_invoke_sign(&smimein, NULL, &smimeerr, -1, fileno(smimeout), -1, filetosign);
+  pid = smime_invoke_sign(&fp_smime_in, NULL, &fp_smime_err, -1,
+                          fileno(fp_smime_out), -1, filetosign);
   if (pid == -1)
   {
     mutt_perror(_("Can't open OpenSSL subprocess"));
-    mutt_file_fclose(&smimeout);
+    mutt_file_fclose(&fp_smime_out);
     mutt_file_unlink(signedfile);
     mutt_file_unlink(filetosign);
     return NULL;
   }
-  fputs(SmimePass, smimein);
-  fputc('\n', smimein);
-  mutt_file_fclose(&smimein);
+  fputs(SmimePass, fp_smime_in);
+  fputc('\n', fp_smime_in);
+  mutt_file_fclose(&fp_smime_in);
 
   mutt_wait_filter(pid);
 
   /* check for errors from OpenSSL */
   err = 0;
-  fflush(smimeerr);
-  rewind(smimeerr);
-  while (fgets(buf, sizeof(buf) - 1, smimeerr))
+  fflush(fp_smime_err);
+  rewind(fp_smime_err);
+  while (fgets(buf, sizeof(buf) - 1, fp_smime_err))
   {
     err = 1;
     fputs(buf, stdout);
   }
-  mutt_file_fclose(&smimeerr);
+  mutt_file_fclose(&fp_smime_err);
 
-  fflush(smimeout);
-  rewind(smimeout);
-  empty = (fgetc(smimeout) == EOF);
-  mutt_file_fclose(&smimeout);
+  fflush(fp_smime_out);
+  rewind(fp_smime_out);
+  empty = (fgetc(fp_smime_out) == EOF);
+  mutt_file_fclose(&fp_smime_out);
 
   mutt_file_unlink(filetosign);
 
@@ -1836,52 +1840,53 @@ struct Body *smime_class_sign_message(struct Body *a)
 
 /**
  * smime_invoke_verify - Use SMIME to verify a file
- * @param[out] smimein    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] smimeout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] smimeerr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  smimeinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  smimeoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  smimeerrfd stderr for the command, or -1 (OPTIONAL)
+ * @param[out] fp_smime_in    stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_out   stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_err   stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  fp_smime_infd  stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_outfd stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_errfd stderr for the command, or -1 (OPTIONAL)
  * @param[in]  fname      Filename to pass to the command
  * @param[in]  sig_fname  Signature filename to pass to the command
  * @param[in]  opaque     If true, use `$smime_verify_opaque_command` else `$smime_verify_command`
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `smimein` has priority over `smimeinfd`.
- *       Likewise `smimeout` and `smimeerr`.
+ * @note `fp_smime_in` has priority over `fp_smime_infd`.
+ *       Likewise `fp_smime_out` and `fp_smime_err`.
  */
-static pid_t smime_invoke_verify(FILE **smimein, FILE **smimeout, FILE **smimeerr,
-                                 int smimeinfd, int smimeoutfd, int smimeerrfd,
+static pid_t smime_invoke_verify(FILE **fp_smime_in, FILE **fp_smime_out,
+                                 FILE **fp_smime_err, int fp_smime_infd,
+                                 int fp_smime_outfd, int fp_smime_errfd,
                                  const char *fname, const char *sig_fname, int opaque)
 {
-  return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd,
-                      smimeerrfd, fname, sig_fname, NULL, NULL, NULL, NULL, NULL,
+  return smime_invoke(fp_smime_in, fp_smime_out, fp_smime_err, fp_smime_infd, fp_smime_outfd,
+                      fp_smime_errfd, fname, sig_fname, NULL, NULL, NULL, NULL, NULL,
                       (opaque ? C_SmimeVerifyOpaqueCommand : C_SmimeVerifyCommand));
 }
 
 /**
  * smime_invoke_decrypt - Use SMIME to decrypt a file
- * @param[out] smimein    stdin  for the command, or NULL (OPTIONAL)
- * @param[out] smimeout   stdout for the command, or NULL (OPTIONAL)
- * @param[out] smimeerr   stderr for the command, or NULL (OPTIONAL)
- * @param[in]  smimeinfd  stdin  for the command, or -1 (OPTIONAL)
- * @param[in]  smimeoutfd stdout for the command, or -1 (OPTIONAL)
- * @param[in]  smimeerrfd stderr for the command, or -1 (OPTIONAL)
+ * @param[out] fp_smime_in    stdin  for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_out   stdout for the command, or NULL (OPTIONAL)
+ * @param[out] fp_smime_err   stderr for the command, or NULL (OPTIONAL)
+ * @param[in]  fp_smime_infd  stdin  for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_outfd stdout for the command, or -1 (OPTIONAL)
+ * @param[in]  fp_smime_errfd stderr for the command, or -1 (OPTIONAL)
  * @param[in]  fname      Filename to pass to the command
  * @retval num PID of the created process
  * @retval -1  Error creating pipes or forking
  *
- * @note `smimein` has priority over `smimeinfd`.
- *       Likewise `smimeout` and `smimeerr`.
+ * @note `fp_smime_in` has priority over `fp_smime_infd`.
+ *       Likewise `fp_smime_out` and `fp_smime_err`.
  */
-static pid_t smime_invoke_decrypt(FILE **smimein, FILE **smimeout,
-                                  FILE **smimeerr, int smimeinfd, int smimeoutfd,
-                                  int smimeerrfd, const char *fname)
+static pid_t smime_invoke_decrypt(FILE **fp_smime_in, FILE **fp_smime_out,
+                                  FILE **fp_smime_err, int fp_smime_infd, int fp_smime_outfd,
+                                  int fp_smime_errfd, const char *fname)
 {
-  return smime_invoke(smimein, smimeout, smimeerr, smimeinfd, smimeoutfd,
-                      smimeerrfd, fname, NULL, NULL, NULL, SmimeKeyToUse,
-                      SmimeCertToUse, NULL, C_SmimeDecryptCommand);
+  return smime_invoke(fp_smime_in, fp_smime_out, fp_smime_err, fp_smime_infd,
+                      fp_smime_outfd, fp_smime_errfd, fname, NULL, NULL, NULL,
+                      SmimeKeyToUse, SmimeCertToUse, NULL, C_SmimeDecryptCommand);
 }
 
 /**
@@ -1890,7 +1895,7 @@ static pid_t smime_invoke_decrypt(FILE **smimein, FILE **smimeout,
 int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
 {
   char signedfile[PATH_MAX];
-  FILE *smimeout = NULL;
+  FILE *fp_smime_out = NULL;
   pid_t pid;
   int badsig = -1;
 
@@ -1936,8 +1941,8 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem
 
   sigbdy->type = orig_type;
 
-  FILE *smimeerr = mutt_file_mkstemp();
-  if (!smimeerr)
+  FILE *fp_smime_err = mutt_file_mkstemp();
+  if (!fp_smime_err)
   {
     mutt_perror(_("Can't create temporary file"));
     mutt_file_unlink(signedfile);
@@ -1946,12 +1951,12 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem
 
   crypt_current_time(s, "OpenSSL");
 
-  pid = smime_invoke_verify(NULL, &smimeout, NULL, -1, -1, fileno(smimeerr),
-                            tempfile, signedfile, 0);
+  pid = smime_invoke_verify(NULL, &fp_smime_out, NULL, -1, -1,
+                            fileno(fp_smime_err), tempfile, signedfile, 0);
   if (pid != -1)
   {
-    fflush(smimeout);
-    mutt_file_fclose(&smimeout);
+    fflush(fp_smime_out);
+    mutt_file_fclose(&fp_smime_out);
 
     if (mutt_wait_filter(pid))
       badsig = -1;
@@ -1961,10 +1966,10 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem
       int lineno = 0;
       size_t linelen;
 
-      fflush(smimeerr);
-      rewind(smimeerr);
+      fflush(fp_smime_err);
+      rewind(fp_smime_err);
 
-      line = mutt_file_read_line(line, &linelen, smimeerr, &lineno, 0);
+      line = mutt_file_read_line(line, &linelen, fp_smime_err, &lineno, 0);
       if (linelen && (mutt_str_strcasecmp(line, "verification successful") == 0))
         badsig = 0;
 
@@ -1972,10 +1977,10 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem
     }
   }
 
-  fflush(smimeerr);
-  rewind(smimeerr);
-  mutt_file_copy_stream(smimeerr, s->fp_out);
-  mutt_file_fclose(&smimeerr);
+  fflush(fp_smime_err);
+  rewind(fp_smime_err);
+  mutt_file_copy_stream(fp_smime_err, s->fp_out);
+  mutt_file_fclose(&fp_smime_err);
 
   state_attach_puts(_("[-- End of OpenSSL output --]\n\n"), s);
 
@@ -1993,17 +1998,17 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem
 
 /**
  * smime_handle_entity - Handle type application/pkcs7-mime
- * @param m        Body to handle
- * @param s        State to use
- * @param out_file File for the result
+ * @param m           Body to handle
+ * @param s           State to use
+ * @param fp_out_file File for the result
  * @retval ptr Body for parsed MIME part
  *
  * This can either be a signed or an encrypted message.
  */
-static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *out_file)
+static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *fp_out_file)
 {
   char tmpfname[PATH_MAX];
-  FILE *tmpfp = NULL, *tmpfp_buffer = NULL, *fpout = NULL;
+  FILE *fp_tmp = NULL, *fp_tmp_buffer = NULL, *fp_out = NULL;
   struct stat info;
   struct Body *p = NULL;
   pid_t pid = -1;
@@ -2012,65 +2017,66 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
   if (!(type & APPLICATION_SMIME))
     return NULL;
 
-  FILE *smimeout = mutt_file_mkstemp();
-  if (!smimeout)
+  FILE *fp_smime_out = mutt_file_mkstemp();
+  if (!fp_smime_out)
   {
     mutt_perror(_("Can't create temporary file"));
     return NULL;
   }
 
-  FILE *smimeerr = mutt_file_mkstemp();
-  if (!smimeerr)
+  FILE *fp_smime_err = mutt_file_mkstemp();
+  if (!fp_smime_err)
   {
     mutt_perror(_("Can't create temporary file"));
-    mutt_file_fclose(&smimeout);
+    mutt_file_fclose(&fp_smime_out);
     return NULL;
   }
 
   mutt_mktemp(tmpfname, sizeof(tmpfname));
-  tmpfp = mutt_file_fopen(tmpfname, "w+");
-  if (!tmpfp)
+  fp_tmp = mutt_file_fopen(tmpfname, "w+");
+  if (!fp_tmp)
   {
     mutt_perror(tmpfname);
-    mutt_file_fclose(&smimeout);
-    mutt_file_fclose(&smimeerr);
+    mutt_file_fclose(&fp_smime_out);
+    mutt_file_fclose(&fp_smime_err);
     return NULL;
   }
 
   fseeko(s->fp_in, m->offset, SEEK_SET);
 
-  mutt_file_copy_bytes(s->fp_in, tmpfp, m->length);
+  mutt_file_copy_bytes(s->fp_in, fp_tmp, m->length);
 
-  fflush(tmpfp);
-  mutt_file_fclose(&tmpfp);
+  fflush(fp_tmp);
+  mutt_file_fclose(&fp_tmp);
 
-  FILE *smimein = NULL;
+  FILE *fp_smime_in = NULL;
   if ((type & SEC_ENCRYPT) &&
-      (pid = smime_invoke_decrypt(&smimein, NULL, NULL, -1, fileno(smimeout),
-                                  fileno(smimeerr), tmpfname)) == -1)
+      (pid = smime_invoke_decrypt(&fp_smime_in, NULL, NULL, -1, fileno(fp_smime_out),
+                                  fileno(fp_smime_err), tmpfname)) == -1)
   {
-    mutt_file_fclose(&smimeout);
+    mutt_file_fclose(&fp_smime_out);
     mutt_file_unlink(tmpfname);
     if (s->flags & MUTT_DISPLAY)
     {
       state_attach_puts(
           _("[-- Error: unable to create OpenSSL subprocess --]\n"), s);
     }
-    mutt_file_fclose(&smimeerr);
+    mutt_file_fclose(&fp_smime_err);
     return NULL;
   }
   else if ((type & SEC_SIGNOPAQUE) &&
-           (pid = smime_invoke_verify(&smimein, NULL, NULL, -1, fileno(smimeout), fileno(smimeerr),
+           (pid = smime_invoke_verify(&fp_smime_in, NULL, NULL, -1,
+                                      fileno(fp_smime_out), fileno(fp_smime_err),
                                       NULL, tmpfname, SEC_SIGNOPAQUE)) == -1)
   {
-    mutt_file_fclose(&smimeout);
+    mutt_file_fclose(&fp_smime_out);
     mutt_file_unlink(tmpfname);
     if (s->flags & MUTT_DISPLAY)
     {
       state_attach_puts(
           _("[-- Error: unable to create OpenSSL subprocess --]\n"), s);
     }
-    mutt_file_fclose(&smimeerr);
+    mutt_file_fclose(&fp_smime_err);
     return NULL;
   }
 
@@ -2078,27 +2084,27 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
   {
     if (!smime_class_valid_passphrase())
       smime_class_void_passphrase();
-    fputs(SmimePass, smimein);
-    fputc('\n', smimein);
+    fputs(SmimePass, fp_smime_in);
+    fputc('\n', fp_smime_in);
   }
 
-  mutt_file_fclose(&smimein);
+  mutt_file_fclose(&fp_smime_in);
 
   mutt_wait_filter(pid);
   mutt_file_unlink(tmpfname);
 
   if (s->flags & MUTT_DISPLAY)
   {
-    fflush(smimeerr);
-    rewind(smimeerr);
+    fflush(fp_smime_err);
+    rewind(fp_smime_err);
 
-    const int c = fgetc(smimeerr);
+    const int c = fgetc(fp_smime_err);
     if (c != EOF)
     {
-      ungetc(c, smimeerr);
+      ungetc(c, fp_smime_err);
 
       crypt_current_time(s, "OpenSSL");
-      mutt_file_copy_stream(smimeerr, s->fp_out);
+      mutt_file_copy_stream(fp_smime_err, s->fp_out);
       state_attach_puts(_("[-- End of OpenSSL output --]\n\n"), s);
     }
 
@@ -2112,35 +2118,35 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
       state_attach_puts(_("[-- The following data is S/MIME signed --]\n"), s);
   }
 
-  fflush(smimeout);
-  rewind(smimeout);
+  fflush(fp_smime_out);
+  rewind(fp_smime_out);
 
   if (type & SEC_ENCRYPT)
   {
     /* void the passphrase, even if that wasn't the problem */
-    if (fgetc(smimeout) == EOF)
+    if (fgetc(fp_smime_out) == EOF)
     {
       mutt_error(_("Decryption failed"));
       smime_class_void_passphrase();
     }
-    rewind(smimeout);
+    rewind(fp_smime_out);
   }
 
-  if (out_file)
-    fpout = out_file;
+  if (fp_out_file)
+    fp_out = fp_out_file;
   else
   {
-    fpout = mutt_file_mkstemp();
-    if (!fpout)
+    fp_out = mutt_file_mkstemp();
+    if (!fp_out)
     {
       mutt_perror(_("Can't create temporary file"));
-      mutt_file_fclose(&smimeout);
-      mutt_file_fclose(&smimeerr);
+      mutt_file_fclose(&fp_smime_out);
+      mutt_file_fclose(&fp_smime_err);
       return NULL;
     }
   }
   char buf[8192];
-  while (fgets(buf, sizeof(buf) - 1, smimeout))
+  while (fgets(buf, sizeof(buf) - 1, fp_smime_out))
   {
     const size_t len = mutt_str_strlen(buf);
     if (len > 1 && buf[len - 2] == '\r')
@@ -2148,18 +2154,18 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
       buf[len - 2] = '\n';
       buf[len - 1] = '\0';
     }
-    fputs(buf, fpout);
+    fputs(buf, fp_out);
   }
-  fflush(fpout);
-  rewind(fpout);
+  fflush(fp_out);
+  rewind(fp_out);
 
-  p = mutt_read_mime_header(fpout, 0);
+  p = mutt_read_mime_header(fp_out, 0);
   if (p)
   {
-    fstat(fileno(fpout), &info);
+    fstat(fileno(fp_out), &info);
     p->length = info.st_size - p->offset;
 
-    mutt_parse_part(fpout, p);
+    mutt_parse_part(fp_out, p);
 
     if (s->flags & MUTT_DISPLAY)
       mutt_protected_headers_handler(p, s);
@@ -2174,11 +2180,11 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
 
     if (s->fp_out)
     {
-      rewind(fpout);
-      tmpfp_buffer = s->fp_in;
-      s->fp_in = fpout;
+      rewind(fp_out);
+      fp_tmp_buffer = s->fp_in;
+      s->fp_in = fp_out;
       mutt_body_handler(p, s);
-      s->fp_in = tmpfp_buffer;
+      s->fp_in = fp_tmp_buffer;
     }
 
     /* Embedded multipart signed protected headers override the
@@ -2192,13 +2198,13 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
       p->parts->mime_headers = NULL;
     }
   }
-  mutt_file_fclose(&smimeout);
+  mutt_file_fclose(&fp_smime_out);
 
-  if (!out_file)
+  if (!fp_out_file)
   {
-    mutt_file_fclose(&fpout);
+    mutt_file_fclose(&fp_out);
   }
-  fpout = NULL;
+  fp_out = NULL;
 
   if (s->flags & MUTT_DISPLAY)
   {
@@ -2214,9 +2220,9 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
     int lineno = 0;
     size_t linelen;
 
-    rewind(smimeerr);
+    rewind(fp_smime_err);
 
-    line = mutt_file_read_line(line, &linelen, smimeerr, &lineno, 0);
+    line = mutt_file_read_line(line, &linelen, fp_smime_err, &lineno, 0);
     if (linelen && (mutt_str_strcasecmp(line, "verification successful") == 0))
       m->goodsig = true;
     FREE(&line);
@@ -2226,7 +2232,7 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
     m->goodsig = p->goodsig;
     m->badsig = p->badsig;
   }
-  mutt_file_fclose(&smimeerr);
+  mutt_file_fclose(&fp_smime_err);
 
   return p;
 }
@@ -2234,7 +2240,7 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o
 /**
  * smime_class_decrypt_mime - Implements CryptModuleSpecs::decrypt_mime()
  */
-int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
+int smime_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 {
   struct State s = { 0 };
   LOFF_T tmpoffset = b->offset;
@@ -2248,34 +2254,34 @@ int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
   if (b->parts)
     return -1;
 
-  s.fp_in = fpin;
+  s.fp_in = fp_in;
   fseeko(s.fp_in, b->offset, SEEK_SET);
 
-  FILE *tmpfp = mutt_file_mkstemp();
-  if (!tmpfp)
+  FILE *fp_tmp = mutt_file_mkstemp();
+  if (!fp_tmp)
   {
     mutt_perror(_("Can't create temporary file"));
     return -1;
   }
 
-  s.fp_out = tmpfp;
+  s.fp_out = fp_tmp;
   mutt_decode_attachment(b, &s);
-  fflush(tmpfp);
+  fflush(fp_tmp);
   b->length = ftello(s.fp_out);
   b->offset = 0;
-  rewind(tmpfp);
-  s.fp_in = tmpfp;
+  rewind(fp_tmp);
+  s.fp_in = fp_tmp;
   s.fp_out = 0;
 
-  *fpout = mutt_file_mkstemp();
-  if (!*fpout)
+  *fp_out = mutt_file_mkstemp();
+  if (!*fp_out)
   {
     mutt_perror(_("Can't create temporary file"));
     rc = -1;
     goto bail;
   }
 
-  *cur = smime_handle_entity(b, &s, *fpout);
+  *cur = smime_handle_entity(b, &s, *fp_out);
   if (!*cur)
   {
     rc = -1;
@@ -2289,9 +2295,9 @@ bail:
   b->type = orig_type;
   b->length = tmplength;
   b->offset = tmpoffset;
-  mutt_file_fclose(&tmpfp);
-  if (*fpout)
-    rewind(*fpout);
+  mutt_file_fclose(&fp_tmp);
+  if (*fp_out)
+    rewind(*fp_out);
 
   return rc;
 }
index 0be6555f3b25e8fa8a9d3cbb92a943c79faf4519..8451ff3f9e54ded71adbf15569abf6f50a5dafd9 100644 (file)
@@ -49,7 +49,7 @@ struct SmimeKey
 
 int          smime_class_application_handler(struct Body *m, struct State *s);
 struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist);
-int          smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
+int          smime_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
 char *       smime_class_find_keys(struct Address *addrlist, bool oppenc_mode);
 void         smime_class_getkeys(struct Envelope *env);
 void         smime_class_invoke_import(char *infile, char *mailbox);
index b95172af53e5a98b0c6e0ce5893b7f9e5fabc8d6..0ef3f6338a12bad891b17fcf85aaa72448a237ec 100644 (file)
@@ -122,12 +122,12 @@ void nntp_acache_free(struct NntpMboxData *mdata)
  */
 void nntp_newsrc_close(struct NntpAccountData *adata)
 {
-  if (!adata->newsrc_fp)
+  if (!adata->fp_newsrc)
     return;
 
   mutt_debug(LL_DEBUG1, "Unlocking %s\n", adata->newsrc_file);
-  mutt_file_unlock(fileno(adata->newsrc_fp));
-  mutt_file_fclose(&adata->newsrc_fp);
+  mutt_file_unlock(fileno(adata->fp_newsrc));
+  mutt_file_fclose(&adata->fp_newsrc);
 }
 
 /**
@@ -166,21 +166,21 @@ int nntp_newsrc_parse(struct NntpAccountData *adata)
   char *line = NULL;
   struct stat sb;
 
-  if (adata->newsrc_fp)
+  if (adata->fp_newsrc)
   {
     /* if we already have a handle, close it and reopen */
-    mutt_file_fclose(&adata->newsrc_fp);
+    mutt_file_fclose(&adata->fp_newsrc);
   }
   else
   {
     /* if file doesn't exist, create it */
-    adata->newsrc_fp = mutt_file_fopen(adata->newsrc_file, "a");
-    mutt_file_fclose(&adata->newsrc_fp);
+    adata->fp_newsrc = mutt_file_fopen(adata->newsrc_file, "a");
+    mutt_file_fclose(&adata->fp_newsrc);
   }
 
   /* open .newsrc */
-  adata->newsrc_fp = mutt_file_fopen(adata->newsrc_file, "r");
-  if (!adata->newsrc_fp)
+  adata->fp_newsrc = mutt_file_fopen(adata->newsrc_file, "r");
+  if (!adata->fp_newsrc)
   {
     mutt_perror(adata->newsrc_file);
     return -1;
@@ -188,9 +188,9 @@ int nntp_newsrc_parse(struct NntpAccountData *adata)
 
   /* lock it */
   mutt_debug(LL_DEBUG1, "Locking %s\n", adata->newsrc_file);
-  if (mutt_file_lock(fileno(adata->newsrc_fp), false, true))
+  if (mutt_file_lock(fileno(adata->fp_newsrc), false, true))
   {
-    mutt_file_fclose(&adata->newsrc_fp);
+    mutt_file_fclose(&adata->fp_newsrc);
     return -1;
   }
 
@@ -223,7 +223,7 @@ int nntp_newsrc_parse(struct NntpAccountData *adata)
   }
 
   line = mutt_mem_malloc(sb.st_size + 1);
-  while (sb.st_size && fgets(line, sb.st_size + 1, adata->newsrc_fp))
+  while (sb.st_size && fgets(line, sb.st_size + 1, adata->fp_newsrc))
   {
     char *b = NULL, *h = NULL;
     unsigned int j = 1;
index e8bb4ca0c9248e4c4b4eea017d9ffe6369965756..b81eb94c84f403068f70a1600b4ef50e366b4cde 100644 (file)
@@ -88,7 +88,7 @@ struct NntpAccountData
   unsigned int status     : 3;
   bool cacheable          : 1;
   bool newsrc_modified    : 1;
-  FILE *newsrc_fp;
+  FILE *fp_newsrc;
   char *newsrc_file;
   char *authenticators;
   char *overview_fmt;
index 27d020a134152df094786140aadafbbc00ad42f1..f272ee73c773bc58c46233e1567b9c0b5b76c86d 100644 (file)
@@ -916,11 +916,11 @@ static void append_message(struct Mailbox *m, notmuch_query_t *q,
 
     if (folder)
     {
-      FILE *f = maildir_open_find_message(folder, path, &newpath);
-      if (f)
+      FILE *fp = maildir_open_find_message(folder, path, &newpath);
+      if (fp)
       {
-        e = maildir_parse_stream(MUTT_MAILDIR, f, newpath, false, NULL);
-        fclose(f);
+        e = maildir_parse_stream(MUTT_MAILDIR, fp, newpath, false, NULL);
+        fclose(fp);
 
         mutt_debug(LL_DEBUG1, "nm: not up-to-date: %s -> %s\n", path, newpath);
       }
diff --git a/pager.c b/pager.c
index 456fab1ef8a432cdf33ee7d53fa02c1036dabb10..219a4139a103a5e38ce100db3eaaa5d61ca601b7 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1280,7 +1280,7 @@ static int grok_ansi(unsigned char *buf, int pos, struct AnsiAttr *a)
 
 /**
  * fill_buffer - Fill a buffer from a file
- * @param[in]     f         File to read from
+ * @param[in]     fp        File to read from
  * @param[in,out] last_pos  End of last read
  * @param[in]     offset    Position start reading from
  * @param[out]    buf       Buffer to fill
@@ -1290,7 +1290,7 @@ static int grok_ansi(unsigned char *buf, int pos, struct AnsiAttr *a)
  * @retval >=0 Bytes read
  * @retval -1  Error
  */
-static int fill_buffer(FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf,
+static int fill_buffer(FILE *fp, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf,
                        unsigned char **fmt, size_t *blen, int *buf_ready)
 {
   unsigned char *p = NULL, *q = NULL;
@@ -1300,14 +1300,14 @@ static int fill_buffer(FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char *
   if (*buf_ready == 0)
   {
     if (offset != *last_pos)
-      fseeko(f, offset, SEEK_SET);
-    *buf = (unsigned char *) mutt_file_read_line((char *) *buf, blen, f, &l, MUTT_EOL);
+      fseeko(fp, offset, SEEK_SET);
+    *buf = (unsigned char *) mutt_file_read_line((char *) *buf, blen, fp, &l, MUTT_EOL);
     if (!*buf)
     {
       fmt[0] = 0;
       return -1;
     }
-    *last_pos = ftello(f);
+    *last_pos = ftello(fp);
     b_read = (int) (*last_pos - offset);
     *buf_ready = 1;
 
@@ -1541,7 +1541,7 @@ static int format_line(struct Line **line_info, int n, unsigned char *buf,
 
 /**
  * display_line - Print a line on screen
- * @param[in]  f               File to read from
+ * @param[in]  fp              File to read from
  * @param[out] last_pos        Offset into file
  * @param[out] line_info       Line attributes
  * @param[in]  n               Line number
@@ -1557,7 +1557,7 @@ static int format_line(struct Line **line_info, int n, unsigned char *buf,
  * @retval 0  normal exit, line was not displayed
  * @retval >0 normal exit, line was displayed
  */
-static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
+static int display_line(FILE *fp, LOFF_T *last_pos, struct Line **line_info,
                         int n, int *last, int *max, PagerFlags flags,
                         struct QClass **quote_list, int *q_level, bool *force_redraw,
                         regex_t *search_re, struct MuttWindow *pager_window)
@@ -1599,7 +1599,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
   if (flags & MUTT_PAGER_LOGS)
   {
     /* determine the line class */
-    if (fill_buffer(f, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
+    if (fill_buffer(fp, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
     {
       if (change_last)
         (*last)--;
@@ -1621,7 +1621,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
     if ((*line_info)[n].type == -1)
     {
       /* determine the line class */
-      if (fill_buffer(f, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
+      if (fill_buffer(fp, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
       {
         if (change_last)
           (*last)--;
@@ -1650,7 +1650,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
   if ((flags & MUTT_SHOWCOLOR) && !(*line_info)[n].continuation &&
       ((*line_info)[n].type == MT_COLOR_QUOTED) && !(*line_info)[n].quote)
   {
-    if (fill_buffer(f, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
+    if (fill_buffer(fp, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
     {
       if (change_last)
         (*last)--;
@@ -1672,7 +1672,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
   if ((flags & MUTT_SEARCH) && !(*line_info)[n].continuation &&
       (*line_info)[n].search_cnt == -1)
   {
-    if (fill_buffer(f, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
+    if (fill_buffer(fp, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready) < 0)
     {
       if (change_last)
         (*last)--;
@@ -1718,7 +1718,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info,
     goto out; /* fake display */
   }
 
-  b_read = fill_buffer(f, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready);
+  b_read = fill_buffer(fp, last_pos, (*line_info)[n].offset, &buf, &fmt, &buflen, &buf_ready);
   if (b_read < 0)
   {
     if (change_last)
index c98095a78e87177ee00cc1ebeb10fd01e160ef90..8593e9a1775bcc7d0fc4ecf402ae3897cbe448f7 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -160,10 +160,10 @@ static struct PopEmailData *pop_edata_new(const char *uid)
  */
 static int fetch_message(char *line, void *file)
 {
-  FILE *f = file;
+  FILE *fp = file;
 
-  fputs(line, f);
-  if (fputc('\n', f) == EOF)
+  fputs(line, fp);
+  if (fputc('\n', fp) == EOF)
     return -1;
 
   return 0;
@@ -180,8 +180,8 @@ static int fetch_message(char *line, void *file)
  */
 static int pop_read_header(struct PopAccountData *adata, struct Email *e)
 {
-  FILE *f = mutt_file_mkstemp();
-  if (!f)
+  FILE *fp = mutt_file_mkstemp();
+  if (!fp)
   {
     mutt_perror(_("Can't create temporary file"));
     return -3;
@@ -198,7 +198,7 @@ static int pop_read_header(struct PopAccountData *adata, struct Email *e)
     sscanf(buf, "+OK %d %zu", &index, &length);
 
     snprintf(buf, sizeof(buf), "TOP %d 0\r\n", e->refno);
-    rc = pop_fetch_data(adata, buf, NULL, fetch_message, f);
+    rc = pop_fetch_data(adata, buf, NULL, fetch_message, fp);
 
     if (adata->cmd_top == 2)
     {
@@ -224,14 +224,14 @@ static int pop_read_header(struct PopAccountData *adata, struct Email *e)
   {
     case 0:
     {
-      rewind(f);
-      e->env = mutt_rfc822_read_header(f, e, false, false);
+      rewind(fp);
+      e->env = mutt_rfc822_read_header(fp, e, false, false);
       e->content->length = length - e->content->offset + 1;
-      rewind(f);
-      while (!feof(f))
+      rewind(fp);
+      while (!feof(fp))
       {
         e->content->length--;
-        fgets(buf, sizeof(buf), f);
+        fgets(buf, sizeof(buf), fp);
       }
       break;
     }
@@ -247,7 +247,7 @@ static int pop_read_header(struct PopAccountData *adata, struct Email *e)
     }
   }
 
-  mutt_file_fclose(&f);
+  mutt_file_fclose(&fp);
   return rc;
 }
 
index 188f0871d96a5bb61dfebdcbe11a37c14e4786e2..81f7203da96dac7dc18eed74678553788a60abab 100644 (file)
@@ -585,7 +585,7 @@ int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
   struct Message *msg = NULL;
   char file[PATH_MAX];
   struct Body *b = NULL;
-  FILE *bfp = NULL;
+  FILE *fp_body = NULL;
   int rc = -1;
   struct State s = { 0 };
   SecurityFlags sec_type;
@@ -597,7 +597,7 @@ int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
   if (!fp)
     fp = msg->fp;
 
-  bfp = fp;
+  fp_body = fp;
 
   /* parse the message header and MIME structure */
 
@@ -628,7 +628,7 @@ int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
       goto bail;
 
     mutt_message(_("Decrypting message..."));
-    if ((crypt_pgp_decrypt_mime(fp, &bfp, newhdr->content, &b) == -1) || !b)
+    if ((crypt_pgp_decrypt_mime(fp, &fp_body, newhdr->content, &b) == -1) || !b)
     {
       goto bail;
     }
@@ -683,7 +683,7 @@ int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
   if (newhdr->content->type == TYPE_MULTIPART)
     newhdr->content = mutt_remove_multipart(newhdr->content);
 
-  s.fp_in = bfp;
+  s.fp_in = fp_body;
 
   /* create temporary files for all attachments */
   for (b = newhdr->content; b; b = b->next)
@@ -823,8 +823,8 @@ int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr,
 bail:
 
   /* that's it. */
-  if (bfp != fp)
-    mutt_file_fclose(&bfp);
+  if (fp_body != fp)
+    mutt_file_fclose(&fp_body);
   if (msg)
     mx_msg_close(m, &msg);
 
index 1828d39cdb61d3aa932f5f607e65d987ea40f240..ac334931740fba834312e11ded642b642b572f71 100644 (file)
@@ -590,7 +590,7 @@ void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
   char *directory = NULL;
   int rc = 1;
   int last = menu ? menu->current : -1;
-  FILE *fpout = NULL;
+  FILE *fp_out = NULL;
 
   buf[0] = 0;
 
@@ -621,19 +621,19 @@ void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
           if (mutt_check_overwrite(top->filename, buf, tfile, sizeof(tfile), &append, NULL))
             return;
           rc = mutt_save_attachment(fp, top, tfile, append, e);
-          if ((rc == 0) && C_AttachSep && (fpout = fopen(tfile, "a")))
+          if ((rc == 0) && C_AttachSep && (fp_out = fopen(tfile, "a")))
           {
-            fprintf(fpout, "%s", C_AttachSep);
-            mutt_file_fclose(&fpout);
+            fprintf(fp_out, "%s", C_AttachSep);
+            mutt_file_fclose(&fp_out);
           }
         }
         else
         {
           rc = mutt_save_attachment(fp, top, tfile, MUTT_SAVE_APPEND, e);
-          if ((rc == 0) && C_AttachSep && (fpout = fopen(tfile, "a")))
+          if ((rc == 0) && C_AttachSep && (fp_out = fopen(tfile, "a")))
           {
-            fprintf(fpout, "%s", C_AttachSep);
-            mutt_file_fclose(&fpout);
+            fprintf(fp_out, "%s", C_AttachSep);
+            mutt_file_fclose(&fp_out);
           }
         }
       }
@@ -733,14 +733,14 @@ static void pipe_attachment(FILE *fp, struct Body *b, struct State *state)
   }
   else
   {
-    FILE *ifp = fopen(b->filename, "r");
-    if (!ifp)
+    FILE *fp_in = fopen(b->filename, "r");
+    if (!fp_in)
     {
       mutt_perror("fopen");
       return;
     }
-    mutt_file_copy_stream(ifp, state->fp_out);
-    mutt_file_fclose(&ifp);
+    mutt_file_copy_stream(fp_in, state->fp_out);
+    mutt_file_fclose(&fp_in);
     if (C_AttachSep)
       state_puts(C_AttachSep, state);
   }
@@ -897,7 +897,7 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
           /* decode and print */
 
           char newfile[PATH_MAX] = "";
-          FILE *ifp = NULL;
+          FILE *fp_in = NULL;
 
           mutt_mktemp(newfile, sizeof(newfile));
           if (mutt_decode_save_attachment(fp, top, newfile, MUTT_PRINTING, 0) == 0)
@@ -909,11 +909,11 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
               return;
             }
 
-            ifp = fopen(newfile, "r");
-            if (ifp)
+            fp_in = fopen(newfile, "r");
+            if (fp_in)
             {
-              mutt_file_copy_stream(ifp, state->fp_out);
-              mutt_file_fclose(&ifp);
+              mutt_file_copy_stream(fp_in, state->fp_out);
+              mutt_file_fclose(&fp_in);
               if (C_AttachSep)
                 state_puts(C_AttachSep, state);
             }
@@ -1137,7 +1137,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *
   struct AttachPtr *new = NULL;
   struct Body *m = NULL;
   struct Body *new_body = NULL;
-  FILE *new_fp = NULL;
+  FILE *fp_new = NULL;
   SecurityFlags type;
   int need_secured, secured;
 
@@ -1159,7 +1159,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *
           crypt_smime_getkeys(e->env);
       }
 
-      secured = !crypt_smime_decrypt_mime(fp, &new_fp, m, &new_body);
+      secured = !crypt_smime_decrypt_mime(fp, &fp_new, m, &new_body);
       /* If the decrypt/verify-opaque doesn't generate mime output, an empty
        * text/plain type will still be returned by mutt_read_mime_header().
        * We can't distinguish an actual part from a failure, so only use a
@@ -1169,7 +1169,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *
           ((parts != m) || m->next))
       {
         mutt_body_free(&new_body);
-        mutt_file_fclose(&new_fp);
+        mutt_file_fclose(&fp_new);
         goto decrypt_failed;
       }
 
@@ -1185,7 +1185,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *
       if (!crypt_valid_passphrase(APPLICATION_PGP))
         goto decrypt_failed;
 
-      secured = !crypt_pgp_decrypt_mime(fp, &new_fp, m, &new_body);
+      secured = !crypt_pgp_decrypt_mime(fp, &fp_new, m, &new_body);
 
       if (secured)
         e->security |= PGP_ENCRYPT;
@@ -1193,9 +1193,9 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *
 
     if (need_secured && secured)
     {
-      mutt_actx_add_fp(actx, new_fp);
+      mutt_actx_add_fp(actx, fp_new);
       mutt_actx_add_body(actx, new_body);
-      mutt_generate_recvattach_list(actx, e, new_body, new_fp, parent_type, level, 1);
+      mutt_generate_recvattach_list(actx, e, new_body, fp_new, parent_type, level, 1);
       continue;
     }
 
@@ -1268,7 +1268,7 @@ static void mutt_update_recvattach_menu(struct AttachCtx *actx, struct Menu *men
   if (init)
   {
     mutt_generate_recvattach_list(actx, actx->email, actx->email->content,
-                                  actx->root_fp, -1, 0, 0);
+                                  actx->fp_root, -1, 0, 0);
     mutt_attach_init(actx);
     menu->data = actx;
   }
@@ -1344,7 +1344,7 @@ void mutt_view_attachments(struct Email *e)
 
   struct AttachCtx *actx = mutt_mem_calloc(sizeof(struct AttachCtx), 1);
   actx->email = e;
-  actx->root_fp = msg->fp;
+  actx->fp_root = msg->fp;
   mutt_update_recvattach_menu(actx, menu, true);
 
   while (true)
index f5926554de5581a915d140293d96ac9c0ffa8586..1acc607887403b225466ead7cbd286a97f2cb5ba 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -392,12 +392,12 @@ static struct AttachPtr *find_parent(struct AttachCtx *actx, struct Body *cur, s
 /**
  * include_header - Write an email header to a file, optionally quoting it
  * @param quote  If true, prefix the lines
- * @param ifp    File to read from
- * @param e    Email
- * @param ofp    File to write to
+ * @param fp_in  File to read from
+ * @param e      Email
+ * @param fp_out File to write to
  * @param prefix Prefix for each line (OPTIONAL)
  */
-static void include_header(bool quote, FILE *ifp, struct Email *e, FILE *ofp, char *prefix)
+static void include_header(bool quote, FILE *fp_in, struct Email *e, FILE *fp_out, char *prefix)
 {
   CopyHeaderFlags chflags = CH_DECODE;
   char prefix2[128];
@@ -420,7 +420,7 @@ static void include_header(bool quote, FILE *ifp, struct Email *e, FILE *ofp, ch
     chflags |= CH_PREFIX;
   }
 
-  mutt_copy_header(ifp, e, ofp, chflags, quote ? prefix2 : NULL);
+  mutt_copy_header(fp_in, e, fp_out, chflags, quote ? prefix2 : NULL);
 }
 
 /**
@@ -463,7 +463,7 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
   bool mime_fwd_all = false;
   bool mime_fwd_any = true;
   struct Email *e_parent = NULL;
-  FILE *parent_fp = NULL;
+  FILE *fp_parent = NULL;
   char tmpbody[PATH_MAX];
   char prefix[256];
   int rc = 0;
@@ -476,12 +476,12 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
   if (parent)
   {
     e_parent = parent->content->email;
-    parent_fp = parent->fp;
+    fp_parent = parent->fp;
   }
   else
   {
     e_parent = e;
-    parent_fp = actx->root_fp;
+    fp_parent = actx->fp_root;
   }
 
   struct Email *e_tmp = mutt_email_new();
@@ -489,15 +489,15 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
   mutt_make_forward_subject(e_tmp->env, Context->mailbox, e_parent);
 
   mutt_mktemp(tmpbody, sizeof(tmpbody));
-  FILE *tmpfp = mutt_file_fopen(tmpbody, "w");
-  if (!tmpfp)
+  FILE *fp_tmp = mutt_file_fopen(tmpbody, "w");
+  if (!fp_tmp)
   {
     mutt_error(_("Can't open temporary file %s"), tmpbody);
     mutt_email_free(&e_tmp);
     return;
   }
 
-  mutt_forward_intro(Context->mailbox, e_parent, tmpfp);
+  mutt_forward_intro(Context->mailbox, e_parent, fp_tmp);
 
   /* prepare the prefix here since we'll need it later. */
 
@@ -512,7 +512,7 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
       mutt_str_strfcpy(prefix, ">", sizeof(prefix));
   }
 
-  include_header(C_ForwardQuote, parent_fp, e_parent, tmpfp, prefix);
+  include_header(C_ForwardQuote, fp_parent, e_parent, fp_tmp, prefix);
 
   /* Now, we have prepared the first part of the message body: The
    * original message's header.
@@ -552,7 +552,7 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
   st.flags = MUTT_CHARCONV;
   if (C_Weed)
     st.flags |= MUTT_WEED;
-  st.fp_out = tmpfp;
+  st.fp_out = fp_tmp;
 
   /* where do we append new MIME parts? */
   struct Body **last = &e_tmp->content;
@@ -594,10 +594,10 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
       goto bail;
   }
 
-  mutt_forward_trailer(Context->mailbox, e_parent, tmpfp);
+  mutt_forward_trailer(Context->mailbox, e_parent, fp_tmp);
 
-  mutt_file_fclose(&tmpfp);
-  tmpfp = NULL;
+  mutt_file_fclose(&fp_tmp);
+  fp_tmp = NULL;
 
   /* now that we have the template, send it. */
   struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
@@ -608,9 +608,9 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a
 
 bail:
 
-  if (tmpfp)
+  if (fp_tmp)
   {
-    mutt_file_fclose(&tmpfp);
+    mutt_file_fclose(&fp_tmp);
     mutt_file_unlink(tmpbody);
   }
 
@@ -640,7 +640,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx,
 
   struct Body **last = NULL;
   char tmpbody[PATH_MAX];
-  FILE *tmpfp = NULL;
+  FILE *fp_tmp = NULL;
 
   CopyHeaderFlags chflags = CH_XMIT;
 
@@ -670,8 +670,8 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx,
     /* no MIME encapsulation */
 
     mutt_mktemp(tmpbody, sizeof(tmpbody));
-    tmpfp = mutt_file_fopen(tmpbody, "w");
-    if (!tmpfp)
+    fp_tmp = mutt_file_fopen(tmpbody, "w");
+    if (!fp_tmp)
     {
       mutt_error(_("Can't create %s"), tmpbody);
       mutt_email_free(&e_tmp);
@@ -697,9 +697,9 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx,
 
     if (cur)
     {
-      mutt_forward_intro(Context->mailbox, cur->email, tmpfp);
-      mutt_copy_message_fp(tmpfp, fp, cur->email, cmflags, chflags);
-      mutt_forward_trailer(Context->mailbox, cur->email, tmpfp);
+      mutt_forward_intro(Context->mailbox, cur->email, fp_tmp);
+      mutt_copy_message_fp(fp_tmp, fp, cur->email, cmflags, chflags);
+      mutt_forward_trailer(Context->mailbox, cur->email, fp_tmp);
     }
     else
     {
@@ -707,14 +707,14 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx,
       {
         if (actx->idx[i]->content->tagged)
         {
-          mutt_forward_intro(Context->mailbox, actx->idx[i]->content->email, tmpfp);
-          mutt_copy_message_fp(tmpfp, actx->idx[i]->fp,
+          mutt_forward_intro(Context->mailbox, actx->idx[i]->content->email, fp_tmp);
+          mutt_copy_message_fp(fp_tmp, actx->idx[i]->fp,
                                actx->idx[i]->content->email, cmflags, chflags);
-          mutt_forward_trailer(Context->mailbox, actx->idx[i]->content->email, tmpfp);
+          mutt_forward_trailer(Context->mailbox, actx->idx[i]->content->email, fp_tmp);
         }
       }
     }
-    mutt_file_fclose(&tmpfp);
+    mutt_file_fclose(&fp_tmp);
   }
   else if (rc == MUTT_YES) /* do MIME encapsulation - we don't need to do much here */
   {
@@ -871,16 +871,16 @@ static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx
 
 /**
  * attach_include_reply - This is _very_ similar to send.c's include_reply()
- * @param fp    File handle to attachment
- * @param tmpfp File handle to temporary file
+ * @param fp     File handle to attachment
+ * @param fp_tmp File handle to temporary file
  * @param cur   Email
  */
-static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Email *cur)
+static void attach_include_reply(FILE *fp, FILE *fp_tmp, struct Email *cur)
 {
   CopyMessageFlags cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV;
   CopyHeaderFlags chflags = CH_DECODE;
 
-  mutt_make_attribution(Context->mailbox, cur, tmpfp);
+  mutt_make_attribution(Context->mailbox, cur, fp_tmp);
 
   if (!C_Header)
     cmflags |= MUTT_CM_NOHEADER;
@@ -890,8 +890,8 @@ static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Email *cur)
     cmflags |= MUTT_CM_WEED;
   }
 
-  mutt_copy_message_fp(tmpfp, fp, cur, cmflags, chflags);
-  mutt_make_post_indent(Context->mailbox, cur, tmpfp);
+  mutt_copy_message_fp(fp_tmp, fp, cur, cmflags, chflags);
+  mutt_make_post_indent(Context->mailbox, cur, fp_tmp);
 }
 
 /**
@@ -910,12 +910,12 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   short nattach = 0;
   struct AttachPtr *parent = NULL;
   struct Email *e_parent = NULL;
-  FILE *parent_fp = NULL;
+  FILE *fp_parent = NULL;
   struct Email *e_tmp = NULL;
 
   struct State st;
   char tmpbody[PATH_MAX];
-  FILE *tmpfp = NULL;
+  FILE *fp_tmp = NULL;
 
   char prefix[128];
 
@@ -933,12 +933,12 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
     if (parent)
     {
       e_parent = parent->content->email;
-      parent_fp = parent->fp;
+      fp_parent = parent->fp;
     }
     else
     {
       e_parent = e;
-      parent_fp = actx->root_fp;
+      fp_parent = actx->fp_root;
     }
   }
 
@@ -966,8 +966,8 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   }
 
   mutt_mktemp(tmpbody, sizeof(tmpbody));
-  tmpfp = mutt_file_fopen(tmpbody, "w");
-  if (!tmpfp)
+  fp_tmp = mutt_file_fopen(tmpbody, "w");
+  if (!fp_tmp)
   {
     mutt_error(_("Can't create %s"), tmpbody);
     mutt_email_free(&e_tmp);
@@ -977,22 +977,22 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   if (!e_parent)
   {
     if (cur)
-      attach_include_reply(fp, tmpfp, cur->email);
+      attach_include_reply(fp, fp_tmp, cur->email);
     else
     {
       for (short i = 0; i < actx->idxlen; i++)
       {
         if (actx->idx[i]->content->tagged)
-          attach_include_reply(actx->idx[i]->fp, tmpfp, actx->idx[i]->content->email);
+          attach_include_reply(actx->idx[i]->fp, fp_tmp, actx->idx[i]->content->email);
       }
     }
   }
   else
   {
-    mutt_make_attribution(Context->mailbox, e_parent, tmpfp);
+    mutt_make_attribution(Context->mailbox, e_parent, fp_tmp);
 
     memset(&st, 0, sizeof(struct State));
-    st.fp_out = tmpfp;
+    st.fp_out = fp_tmp;
 
     if (!C_TextFlowed)
     {
@@ -1009,7 +1009,7 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
       st.flags |= MUTT_WEED;
 
     if (C_Header)
-      include_header(true, parent_fp, e_parent, tmpfp, prefix);
+      include_header(true, fp_parent, e_parent, fp_tmp, prefix);
 
     if (cur)
     {
@@ -1035,17 +1035,17 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
       }
     }
 
-    mutt_make_post_indent(Context->mailbox, e_parent, tmpfp);
+    mutt_make_post_indent(Context->mailbox, e_parent, fp_tmp);
 
     if (mime_reply_any && !cur && !copy_problematic_attachments(&e_tmp->content, actx, false))
     {
       mutt_email_free(&e_tmp);
-      mutt_file_fclose(&tmpfp);
+      mutt_file_fclose(&fp_tmp);
       return;
     }
   }
 
-  mutt_file_fclose(&tmpfp);
+  mutt_file_fclose(&fp_tmp);
 
   struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
   el_add_email(&el, e_parent ? e_parent : (cur ? cur->email : NULL));
index e2ed8acc03e1ba4af074479e916bed2dbbbcb07d..fa2b48dc45300c96aa5bb825c0099b94a7f39d16 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -403,7 +403,6 @@ void rfc3676_space_stuff(struct Email *e)
   int lc = 0;
   size_t len = 0;
   unsigned char c = '\0';
-  FILE *in = NULL, *out = NULL;
   char buf[1024];
   char tmpfile[PATH_MAX];
 
@@ -412,23 +411,23 @@ void rfc3676_space_stuff(struct Email *e)
 
   mutt_debug(LL_DEBUG2, "f=f: postprocess %s\n", e->content->filename);
 
-  in = mutt_file_fopen(e->content->filename, "r");
-  if (!in)
+  FILE *fp_in = mutt_file_fopen(e->content->filename, "r");
+  if (!fp_in)
     return;
 
   mutt_mktemp(tmpfile, sizeof(tmpfile));
-  out = mutt_file_fopen(tmpfile, "w+");
-  if (!out)
+  FILE *fp_out = mutt_file_fopen(tmpfile, "w+");
+  if (!fp_out)
   {
-    mutt_file_fclose(&in);
+    mutt_file_fclose(&fp_in);
     return;
   }
 
-  while (fgets(buf, sizeof(buf), in))
+  while (fgets(buf, sizeof(buf), fp_in))
   {
     if (buf[0] == ' ' || mutt_str_startswith(buf, "From ", CASE_MATCH))
     {
-      fputc(' ', out);
+      fputc(' ', fp_out);
       lc++;
       len = mutt_str_strlen(buf);
       if (len > 0)
@@ -440,10 +439,10 @@ void rfc3676_space_stuff(struct Email *e)
       if (len > 0)
         buf[len - 1] = c;
     }
-    fputs(buf, out);
+    fputs(buf, fp_out);
   }
-  mutt_file_fclose(&in);
-  mutt_file_fclose(&out);
+  mutt_file_fclose(&fp_in);
+  mutt_file_fclose(&fp_out);
   mutt_file_set_mtime(e->content->filename, tmpfile);
   unlink(e->content->filename);
   mutt_str_replace(&e->content->filename, tmpfile);
diff --git a/send.c b/send.c
index eb6a5fe5cc46e97375fae853aa04a28cac03207b..283b24d810f2b1b3e953c256e012fb68ad280852 100644 (file)
--- a/send.c
+++ b/send.c
@@ -128,19 +128,19 @@ bool C_UseFrom;    ///< Config: Set the 'From' header for outgoing mail
 
 /**
  * append_signature - Append a signature to an email
- * @param f File to write to
+ * @param fp File to write to
  */
-static void append_signature(FILE *f)
+static void append_signature(FILE *fp)
 {
-  FILE *tmpfp = NULL;
+  FILE *fp_tmp = NULL;
   pid_t pid;
 
-  if (C_Signature && (tmpfp = mutt_open_read(C_Signature, &pid)))
+  if (C_Signature && (fp_tmp = mutt_open_read(C_Signature, &pid)))
   {
     if (C_SigDashes)
-      fputs("\n-- \n", f);
-    mutt_file_copy_stream(tmpfp, f);
-    mutt_file_fclose(&tmpfp);
+      fputs("\n-- \n", fp);
+    mutt_file_copy_stream(fp_tmp, fp);
+    mutt_file_fclose(&fp_tmp);
     if (pid != -1)
       mutt_wait_filter(pid);
   }
@@ -487,13 +487,13 @@ void mutt_forward_trailer(struct Mailbox *m, struct Email *e, FILE *fp)
 
 /**
  * include_forward - Write out a forwarded message
- * @param m   Mailbox
- * @param e   Email
- * @param out File to write to
+ * @param m      Mailbox
+ * @param e      Email
+ * @param fp_out File to write to
  * @retval  0 Success
  * @retval -1 Failure
  */
-static int include_forward(struct Mailbox *m, struct Email *e, FILE *out)
+static int include_forward(struct Mailbox *m, struct Email *e, FILE *fp_out)
 {
   CopyHeaderFlags chflags = CH_DECODE;
   CopyMessageFlags cmflags = MUTT_CM_NO_FLAGS;
@@ -508,7 +508,7 @@ static int include_forward(struct Mailbox *m, struct Email *e, FILE *out)
       return -1;
   }
 
-  mutt_forward_intro(m, e, out);
+  mutt_forward_intro(m, e, fp_out);
 
   if (C_ForwardDecode)
   {
@@ -526,56 +526,56 @@ static int include_forward(struct Mailbox *m, struct Email *e, FILE *out)
    * rather than send action */
   chflags |= CH_DISPLAY;
 
-  mutt_copy_message_ctx(out, m, e, cmflags, chflags);
-  mutt_forward_trailer(m, e, out);
+  mutt_copy_message_ctx(fp_out, m, e, cmflags, chflags);
+  mutt_forward_trailer(m, e, fp_out);
   return 0;
 }
 
 /**
  * mutt_make_attribution - Add "on DATE, PERSON wrote" header
- * @param m   Mailbox
- * @param e   Email
- * @param out File to write to
+ * @param m      Mailbox
+ * @param e      Email
+ * @param fp_out File to write to
  */
-void mutt_make_attribution(struct Mailbox *m, struct Email *e, FILE *out)
+void mutt_make_attribution(struct Mailbox *m, struct Email *e, FILE *fp_out)
 {
-  if (!C_Attribution || !out)
+  if (!C_Attribution || !fp_out)
     return;
 
   char buf[1024];
   setlocale(LC_TIME, NONULL(C_AttributionLocale));
   mutt_make_string(buf, sizeof(buf), C_Attribution, NULL, m, e);
   setlocale(LC_TIME, "");
-  fputs(buf, out);
-  fputc('\n', out);
+  fputs(buf, fp_out);
+  fputc('\n', fp_out);
 }
 
 /**
  * mutt_make_post_indent - Add suffix to replied email text
- * @param m   Mailbox
- * @param e   Email
- * @param out File to write to
+ * @param m      Mailbox
+ * @param e      Email
+ * @param fp_out File to write to
  */
-void mutt_make_post_indent(struct Mailbox *m, struct Email *e, FILE *out)
+void mutt_make_post_indent(struct Mailbox *m, struct Email *e, FILE *fp_out)
 {
-  if (!C_PostIndentString || !out)
+  if (!C_PostIndentString || !fp_out)
     return;
 
   char buf[256];
   mutt_make_string(buf, sizeof(buf), C_PostIndentString, NULL, m, e);
-  fputs(buf, out);
-  fputc('\n', out);
+  fputs(buf, fp_out);
+  fputc('\n', fp_out);
 }
 
 /**
  * include_reply - Generate the reply text for an email
- * @param m   Mailbox
- * @param e   Email
- * @param out File to write to
+ * @param m      Mailbox
+ * @param e      Email
+ * @param fp_out File to write to
  * @retval  0 Success
  * @retval -1 Failure
  */
-static int include_reply(struct Mailbox *m, struct Email *e, FILE *out)
+static int include_reply(struct Mailbox *m, struct Email *e, FILE *fp_out)
 {
   CopyMessageFlags cmflags =
       MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV | MUTT_CM_REPLYING;
@@ -591,7 +591,7 @@ static int include_reply(struct Mailbox *m, struct Email *e, FILE *out)
   mutt_parse_mime_message(m, e);
   mutt_message_hook(m, e, MUTT_MESSAGE_HOOK);
 
-  mutt_make_attribution(m, e, out);
+  mutt_make_attribution(m, e, fp_out);
 
   if (!C_Header)
     cmflags |= MUTT_CM_NOHEADER;
@@ -601,9 +601,9 @@ static int include_reply(struct Mailbox *m, struct Email *e, FILE *out)
     cmflags |= MUTT_CM_WEED;
   }
 
-  mutt_copy_message_ctx(out, m, e, cmflags, chflags);
+  mutt_copy_message_ctx(fp_out, m, e, cmflags, chflags);
 
-  mutt_make_post_indent(m, e, out);
+  mutt_make_post_indent(m, e, fp_out);
 
   return 0;
 }
@@ -968,7 +968,7 @@ static int envelope_defaults(struct Envelope *env, struct Mailbox *m,
 
 /**
  * generate_body - Create a new email body
- * @param tempfp Stream for outgoing message
+ * @param fp_tmp Stream for outgoing message
  * @param msg    Header for outgoing message
  * @param flags  Compose mode, see #SendFlags
  * @param m      Mailbox
@@ -976,7 +976,7 @@ static int envelope_defaults(struct Envelope *env, struct Mailbox *m,
  * @retval  0 Success
  * @retval -1 Error
  */
-static int generate_body(FILE *tempfp, struct Email *msg, SendFlags flags,
+static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags,
                          struct Mailbox *m, struct EmailList *el)
 {
   enum QuadOption ans;
@@ -1006,16 +1006,16 @@ static int generate_body(FILE *tempfp, struct Email *msg, SendFlags flags,
       {
         STAILQ_FOREACH(en, el, entries)
         {
-          if (include_reply(m, en->email, tempfp) == -1)
+          if (include_reply(m, en->email, fp_tmp) == -1)
           {
             mutt_error(_("Could not include all requested messages"));
             return -1;
           }
-          fputc('\n', tempfp);
+          fputc('\n', fp_tmp);
         }
       }
       else
-        include_reply(m, en->email, tempfp);
+        include_reply(m, en->email, fp_tmp);
     }
   }
   else if (flags & SEND_FORWARD)
@@ -1059,12 +1059,12 @@ static int generate_body(FILE *tempfp, struct Email *msg, SendFlags flags,
     else if (ans != MUTT_ABORT)
     {
       if (single)
-        include_forward(m, en->email, tempfp);
+        include_forward(m, en->email, fp_tmp);
       else
       {
         STAILQ_FOREACH(en, el, entries)
         {
-          include_forward(m, en->email, tempfp);
+          include_forward(m, en->email, fp_tmp);
         }
       }
     }
@@ -1249,8 +1249,8 @@ static int send_message(struct Email *msg)
 
   /* Write out the message in MIME form. */
   mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *tempfp = mutt_file_fopen(tempfile, "w");
-  if (!tempfp)
+  FILE *fp_tmp = mutt_file_fopen(tempfile, "w");
+  if (!fp_tmp)
     return -1;
 
 #ifdef USE_SMTP
@@ -1259,12 +1259,12 @@ static int send_message(struct Email *msg)
     C_WriteBcc = false;
 #endif
 #ifdef MIXMASTER
-  mutt_rfc822_write_header(tempfp, msg->env, msg->content,
+  mutt_rfc822_write_header(fp_tmp, msg->env, msg->content,
                            MUTT_WRITE_HEADER_NORMAL, !STAILQ_EMPTY(&msg->chain),
                            mutt_should_hide_protected_subject(msg));
 #endif
 #ifndef MIXMASTER
-  mutt_rfc822_write_header(tempfp, msg->env, msg->content, MUTT_WRITE_HEADER_NORMAL,
+  mutt_rfc822_write_header(fp_tmp, msg->env, msg->content, MUTT_WRITE_HEADER_NORMAL,
                            false, mutt_should_hide_protected_subject(msg));
 #endif
 #ifdef USE_SMTP
@@ -1272,16 +1272,16 @@ static int send_message(struct Email *msg)
     C_WriteBcc = true;
 #endif
 
-  fputc('\n', tempfp); /* tie off the header. */
+  fputc('\n', fp_tmp); /* tie off the header. */
 
-  if ((mutt_write_mime_body(msg->content, tempfp) == -1))
+  if ((mutt_write_mime_body(msg->content, fp_tmp) == -1))
   {
-    mutt_file_fclose(&tempfp);
+    mutt_file_fclose(&fp_tmp);
     unlink(tempfile);
     return -1;
   }
 
-  if (fclose(tempfp) != 0)
+  if (fclose(fp_tmp) != 0)
   {
     mutt_perror(tempfile);
     unlink(tempfile);
@@ -1444,15 +1444,15 @@ static bool search_attach_keyword(char *filename)
     return false;
   }
 
-  FILE *attf = mutt_file_fopen(filename, "r");
-  if (!attf)
+  FILE *fp_att = mutt_file_fopen(filename, "r");
+  if (!fp_att)
     return false;
 
   char *inputline = mutt_mem_malloc(1024);
   bool found = false;
-  while (!feof(attf))
+  while (!feof(fp_att))
   {
-    fgets(inputline, 1024, attf);
+    fgets(inputline, 1024, fp_att);
     if (!mutt_is_quote_line(inputline, NULL) &&
         regexec(C_AbortNoattachRegex->regex, inputline, 0, NULL, 0) == 0)
     {
@@ -1461,7 +1461,7 @@ static bool search_attach_keyword(char *filename)
     }
   }
   FREE(&inputline);
-  mutt_file_fclose(&attf);
+  mutt_file_fclose(&fp_att);
   return found;
 }
 
@@ -1743,7 +1743,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
 {
   char buf[1024];
   char fcc[PATH_MAX] = ""; /* where to copy this message */
-  FILE *tempfp = NULL;
+  FILE *fp_tmp = NULL;
   struct Body *pbody = NULL;
   int i;
   bool killfrom = false;
@@ -1834,8 +1834,8 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
 
     if (flags & (SEND_POSTPONED | SEND_RESEND))
     {
-      tempfp = mutt_file_fopen(msg->content->filename, "a+");
-      if (!tempfp)
+      fp_tmp = mutt_file_fopen(msg->content->filename, "a+");
+      if (!fp_tmp)
       {
         mutt_perror(msg->content->filename);
         goto cleanup;
@@ -1878,19 +1878,19 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
       if (!tempfile)
       {
         mutt_mktemp(buf, sizeof(buf));
-        tempfp = mutt_file_fopen(buf, "w+");
+        fp_tmp = mutt_file_fopen(buf, "w+");
         msg->content->filename = mutt_str_strdup(buf);
       }
       else
       {
-        tempfp = mutt_file_fopen(tempfile, "a+");
+        fp_tmp = mutt_file_fopen(tempfile, "a+");
         msg->content->filename = mutt_str_strdup(tempfile);
       }
     }
     else
-      tempfp = mutt_file_fopen(msg->content->filename, "a+");
+      fp_tmp = mutt_file_fopen(msg->content->filename, "a+");
 
-    if (!tempfp)
+    if (!fp_tmp)
     {
       mutt_debug(LL_DEBUG1, "can't create tempfile %s (errno=%d)\n",
                  msg->content->filename, errno);
@@ -2030,17 +2030,17 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
       process_user_header(msg->env);
 
     if (flags & SEND_BATCH)
-      mutt_file_copy_stream(stdin, tempfp);
+      mutt_file_copy_stream(stdin, fp_tmp);
 
     if (C_SigOnTop && !(flags & (SEND_MAILX | SEND_KEY | SEND_BATCH)) &&
         C_Editor && (mutt_str_strcmp(C_Editor, "builtin") != 0))
     {
-      append_signature(tempfp);
+      append_signature(fp_tmp);
     }
 
     /* include replies/forwarded messages, unless we are given a template */
     if (!tempfile && (ctx || !(flags & (SEND_REPLY | SEND_FORWARD))) &&
-        generate_body(tempfp, msg, flags, ctx->mailbox, el) == -1)
+        generate_body(fp_tmp, msg, flags, ctx->mailbox, el) == -1)
     {
       goto cleanup;
     }
@@ -2048,7 +2048,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
     if (!C_SigOnTop && !(flags & (SEND_MAILX | SEND_KEY | SEND_BATCH)) &&
         C_Editor && (mutt_str_strcmp(C_Editor, "builtin") != 0))
     {
-      append_signature(tempfp);
+      append_signature(fp_tmp);
     }
   }
 
@@ -2064,7 +2064,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile,
     msg->env->from->personal = mutt_str_strdup(C_Realname);
 
   if (!(((WithCrypto & APPLICATION_PGP) != 0) && (flags & SEND_KEY)))
-    mutt_file_fclose(&tempfp);
+    mutt_file_fclose(&fp_tmp);
 
   if (flags & SEND_MAILX)
   {
@@ -2518,7 +2518,7 @@ cleanup:
     }
   }
 
-  mutt_file_fclose(&tempfp);
+  mutt_file_fclose(&fp_tmp);
   if (!(flags & SEND_NO_FREE_HEADER))
     mutt_email_free(&msg);
 
diff --git a/send.h b/send.h
index cedc4b1e447e2bb0302728d87fb9a6e66fb9a732..8d859dbaad5a7155cf7a73900d5189088c02a53b 100644 (file)
--- a/send.h
+++ b/send.h
@@ -106,10 +106,10 @@ int             mutt_fetch_recips(struct Envelope *out, struct Envelope *in, Sen
 void            mutt_fix_reply_recipients(struct Envelope *env);
 void            mutt_forward_intro(struct Mailbox *m, struct Email *e, FILE *fp);
 void            mutt_forward_trailer(struct Mailbox *m, struct Email *e, FILE *fp);
-void            mutt_make_attribution(struct Mailbox *m, struct Email *e, FILE *out);
+void            mutt_make_attribution(struct Mailbox *m, struct Email *e, FILE *fp_out);
 void            mutt_make_forward_subject(struct Envelope *env, struct Mailbox *m, struct Email *e);
 void            mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
-void            mutt_make_post_indent(struct Mailbox *m, struct Email *e, FILE *out);
+void            mutt_make_post_indent(struct Mailbox *m, struct Email *e, FILE *fp_out);
 struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b);
 int             mutt_resend_message(FILE *fp, struct Context *ctx, struct Email *cur);
 void            mutt_set_followup_to(struct Envelope *e);
index 830bf9404935293772ada736207793e783939da2..828e22c966370ad1736cad926e4817cfaf00f1a4 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -94,10 +94,10 @@ short C_WrapHeaders;    ///< Config: Width to wrap headers in outgoing messages
 /**
  * encode_quoted - Encode text as quoted printable
  * @param fc     Cursor for converting a file's encoding
- * @param fout   File to store the result
+ * @param fp_out File to store the result
  * @param istext Is the input text?
  */
-static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
+static void encode_quoted(struct FgetConv *fc, FILE *fp_out, bool istext)
 {
   int c, linelen = 0;
   char line[77], savechar;
@@ -114,8 +114,8 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
       if (line[linelen - 3] == '=')
       {
         line[linelen - 3] = 0;
-        fputs(line, fout);
-        fputs("=\n", fout);
+        fputs(line, fp_out);
+        fputs("=\n", fp_out);
         line[linelen] = 0;
         line[0] = '=';
         line[1] = line[linelen - 2];
@@ -127,8 +127,8 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
         savechar = line[linelen - 1];
         line[linelen - 1] = '=';
         line[linelen] = 0;
-        fputs(line, fout);
-        fputc('\n', fout);
+        fputs(line, fp_out);
+        fputc('\n', fp_out);
         line[0] = savechar;
         linelen = 1;
       }
@@ -159,7 +159,7 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
         if (linelen < 74)
         {
           sprintf(line + linelen - 1, "=%2.2X", (unsigned char) line[linelen - 1]);
-          fputs(line, fout);
+          fputs(line, fp_out);
         }
         else
         {
@@ -167,16 +167,16 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
 
           line[linelen - 1] = '=';
           line[linelen] = 0;
-          fputs(line, fout);
-          fprintf(fout, "\n=%2.2X", (unsigned char) savechar2);
+          fputs(line, fp_out);
+          fprintf(fp_out, "\n=%2.2X", (unsigned char) savechar2);
         }
       }
       else
       {
         line[linelen] = 0;
-        fputs(line, fout);
+        fputs(line, fp_out);
       }
-      fputc('\n', fout);
+      fputc('\n', fp_out);
       linelen = 0;
     }
     else if (c != 9 && (c < 32 || c > 126 || c == '='))
@@ -188,8 +188,8 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
       {
         line[linelen++] = '=';
         line[linelen] = 0;
-        fputs(line, fout);
-        fputc('\n', fout);
+        fputs(line, fp_out);
+        fputc('\n', fp_out);
         linelen = 0;
       }
       sprintf(line + linelen, "=%2.2X", (unsigned char) c);
@@ -217,14 +217,14 @@ static void encode_quoted(struct FgetConv *fc, FILE *fout, bool istext)
         savechar = line[linelen - 1];
         line[linelen - 1] = '=';
         line[linelen] = 0;
-        fputs(line, fout);
-        fputc('\n', fout);
+        fputs(line, fp_out);
+        fputc('\n', fp_out);
         sprintf(line, "=%2.2X", (unsigned char) savechar);
       }
     }
     else
       line[linelen] = 0;
-    fputs(line, fout);
+    fputs(line, fp_out);
   }
 }
 
@@ -254,10 +254,10 @@ static int b64_init(struct B64Context *bctx)
 
 /**
  * b64_flush - Save the bytes to the file
- * @param bctx  Cursor for the base64 conversion
- * @param fout File to save the output
+ * @param bctx   Cursor for the base64 conversion
+ * @param fp_out File to save the output
  */
-static void b64_flush(struct B64Context *bctx, FILE *fout)
+static void b64_flush(struct B64Context *bctx, FILE *fp_out)
 {
   /* for some reasons, mutt_b64_encode expects the
    * output buffer to be larger than 10B */
@@ -269,7 +269,7 @@ static void b64_flush(struct B64Context *bctx, FILE *fout)
 
   if (bctx->linelen >= 72)
   {
-    fputc('\n', fout);
+    fputc('\n', fp_out);
     bctx->linelen = 0;
   }
 
@@ -279,7 +279,7 @@ static void b64_flush(struct B64Context *bctx, FILE *fout)
   ret = mutt_b64_encode(bctx->buffer, bctx->size, encoded, sizeof(encoded));
   for (size_t i = 0; i < ret; i++)
   {
-    fputc(encoded[i], fout);
+    fputc(encoded[i], fp_out);
     bctx->linelen++;
   }
 
@@ -288,14 +288,14 @@ static void b64_flush(struct B64Context *bctx, FILE *fout)
 
 /**
  * b64_putc - Base64-encode one character
- * @param bctx  Cursor for the base64 conversion
- * @param c    Character to encode
- * @param fout File to save the output
+ * @param bctx   Cursor for the base64 conversion
+ * @param c      Character to encode
+ * @param fp_out File to save the output
  */
-static void b64_putc(struct B64Context *bctx, char c, FILE *fout)
+static void b64_putc(struct B64Context *bctx, char c, FILE *fp_out)
 {
   if (bctx->size == 3)
-    b64_flush(bctx, fout);
+    b64_flush(bctx, fp_out);
 
   bctx->buffer[bctx->size++] = c;
 }
@@ -303,10 +303,10 @@ static void b64_putc(struct B64Context *bctx, char c, FILE *fout)
 /**
  * encode_base64 - Base64-encode some data
  * @param fc     Cursor for converting a file's encoding
- * @param fout   File to store the result
+ * @param fp_out File to store the result
  * @param istext Is the input text?
  */
-static void encode_base64(struct FgetConv *fc, FILE *fout, int istext)
+static void encode_base64(struct FgetConv *fc, FILE *fp_out, int istext)
 {
   struct B64Context bctx;
   int ch, ch1 = EOF;
@@ -321,20 +321,20 @@ static void encode_base64(struct FgetConv *fc, FILE *fout, int istext)
       return;
     }
     if (istext && ch == '\n' && ch1 != '\r')
-      b64_putc(&bctx, '\r', fout);
-    b64_putc(&bctx, ch, fout);
+      b64_putc(&bctx, '\r', fp_out);
+    b64_putc(&bctx, ch, fp_out);
     ch1 = ch;
   }
-  b64_flush(&bctx, fout);
-  fputc('\n', fout);
+  b64_flush(&bctx, fp_out);
+  fputc('\n', fp_out);
 }
 
 /**
  * encode_8bit - Write the data as raw 8-bit data
  * @param fc     Cursor for converting a file's encoding
- * @param fout   File to store the result
+ * @param fp_out File to store the result
  */
-static void encode_8bit(struct FgetConv *fc, FILE *fout)
+static void encode_8bit(struct FgetConv *fc, FILE *fp_out)
 {
   int ch;
 
@@ -345,20 +345,20 @@ static void encode_8bit(struct FgetConv *fc, FILE *fout)
       SigInt = 0;
       return;
     }
-    fputc(ch, fout);
+    fputc(ch, fp_out);
   }
 }
 
 /**
  * mutt_write_mime_header - Create a MIME header
- * @param a Body part
- * @param f File to write to
+ * @param a  Body part
+ * @param fp File to write to
  * @retval  0 Success
  * @retval -1 Failure
  */
-int mutt_write_mime_header(struct Body *a, FILE *f)
+int mutt_write_mime_header(struct Body *a, FILE *fp)
 {
-  fprintf(f, "Content-Type: %s/%s", TYPE(a), a->subtype);
+  fprintf(fp, "Content-Type: %s/%s", TYPE(a), a->subtype);
 
   if (!TAILQ_EMPTY(&a->parameter))
   {
@@ -372,7 +372,7 @@ int mutt_write_mime_header(struct Body *a, FILE *f)
       if (!np->value)
         continue;
 
-      fputc(';', f);
+      fputc(';', fp);
 
       char buf[256];
       buf[0] = 0;
@@ -396,26 +396,26 @@ int mutt_write_mime_header(struct Body *a, FILE *f)
 
       if (len + tmplen + 2 > 76)
       {
-        fputs("\n\t", f);
+        fputs("\n\t", fp);
         len = tmplen + 8;
       }
       else
       {
-        fputc(' ', f);
+        fputc(' ', fp);
         len += tmplen + 1;
       }
 
-      fprintf(f, "%s%s=%s", np->attribute, encode ? "*" : "", buf);
+      fprintf(fp, "%s%s=%s", np->attribute, encode ? "*" : "", buf);
     }
   }
 
-  fputc('\n', f);
+  fputc('\n', fp);
 
   if (a->language)
-    fprintf(f, "Content-Language: %s\n", a->language);
+    fprintf(fp, "Content-Language: %s\n", a->language);
 
   if (a->description)
-    fprintf(f, "Content-Description: %s\n", a->description);
+    fprintf(fp, "Content-Description: %s\n", a->description);
 
   if (a->disposition != DISP_NONE)
   {
@@ -423,7 +423,7 @@ int mutt_write_mime_header(struct Body *a, FILE *f)
 
     if (a->disposition < sizeof(dispstr) / sizeof(char *))
     {
-      fprintf(f, "Content-Disposition: %s", dispstr[a->disposition]);
+      fprintf(fp, "Content-Disposition: %s", dispstr[a->disposition]);
 
       if (a->use_disp && (a->disposition != DISP_INLINE))
       {
@@ -448,11 +448,11 @@ int mutt_write_mime_header(struct Body *a, FILE *f)
           const int encode = rfc2231_encode_string(&tmp);
           mutt_addr_cat(buf, sizeof(buf), tmp, MimeSpecials);
           FREE(&tmp);
-          fprintf(f, "; filename%s=%s", encode ? "*" : "", buf);
+          fprintf(fp, "; filename%s=%s", encode ? "*" : "", buf);
         }
       }
 
-      fputc('\n', f);
+      fputc('\n', fp);
     }
     else
     {
@@ -461,13 +461,13 @@ int mutt_write_mime_header(struct Body *a, FILE *f)
   }
 
   if (a->encoding != ENC_7BIT)
-    fprintf(f, "Content-Transfer-Encoding: %s\n", ENCODING(a->encoding));
+    fprintf(fp, "Content-Transfer-Encoding: %s\n", ENCODING(a->encoding));
 
   if (C_CryptProtectedHeadersWrite && a->mime_headers)
-    mutt_rfc822_write_header(f, a->mime_headers, NULL, MUTT_WRITE_HEADER_MIME, false, false);
+    mutt_rfc822_write_header(fp, a->mime_headers, NULL, MUTT_WRITE_HEADER_MIME, false, false);
 
   /* Do NOT add the terminator here!!! */
-  return ferror(f) ? -1 : 0;
+  return ferror(fp) ? -1 : 0;
 }
 
 /**
@@ -483,14 +483,14 @@ static bool write_as_text_part(struct Body *b)
 
 /**
  * mutt_write_mime_body - Write a MIME part
- * @param a Body to use
- * @param f File to write to
+ * @param a  Body to use
+ * @param fp File to write to
  * @retval  0 Success
  * @retval -1 Failure
  */
-int mutt_write_mime_body(struct Body *a, FILE *f)
+int mutt_write_mime_body(struct Body *a, FILE *fp)
 {
-  FILE *fpin = NULL;
+  FILE *fp_in = NULL;
   struct FgetConv *fc = NULL;
 
   if (a->type == TYPE_MULTIPART)
@@ -508,27 +508,27 @@ int mutt_write_mime_body(struct Body *a, FILE *f)
 
     for (struct Body *t = a->parts; t; t = t->next)
     {
-      fprintf(f, "\n--%s\n", boundary);
-      if (mutt_write_mime_header(t, f) == -1)
+      fprintf(fp, "\n--%s\n", boundary);
+      if (mutt_write_mime_header(t, fp) == -1)
         return -1;
-      fputc('\n', f);
-      if (mutt_write_mime_body(t, f) == -1)
+      fputc('\n', fp);
+      if (mutt_write_mime_body(t, fp) == -1)
         return -1;
     }
-    fprintf(f, "\n--%s--\n", boundary);
-    return ferror(f) ? -1 : 0;
+    fprintf(fp, "\n--%s--\n", boundary);
+    return ferror(fp) ? -1 : 0;
   }
 
   /* This is pretty gross, but it's the best solution for now... */
   if (((WithCrypto & APPLICATION_PGP) != 0) && a->type == TYPE_APPLICATION &&
       (mutt_str_strcmp(a->subtype, "pgp-encrypted") == 0))
   {
-    fputs("Version: 1\n", f);
+    fputs("Version: 1\n", fp);
     return 0;
   }
 
-  fpin = fopen(a->filename, "r");
-  if (!fpin)
+  fp_in = fopen(a->filename, "r");
+  if (!fp_in)
   {
     mutt_debug(LL_DEBUG1, "%s no longer exists\n", a->filename);
     mutt_error(_("%s no longer exists"), a->filename);
@@ -539,31 +539,32 @@ int mutt_write_mime_body(struct Body *a, FILE *f)
   {
     char send_charset[128];
     fc = mutt_ch_fgetconv_open(
-        fpin, a->charset, mutt_body_get_charset(a, send_charset, sizeof(send_charset)), 0);
+        fp_in, a->charset,
+        mutt_body_get_charset(a, send_charset, sizeof(send_charset)), 0);
   }
   else
-    fc = mutt_ch_fgetconv_open(fpin, 0, 0, 0);
+    fc = mutt_ch_fgetconv_open(fp_in, 0, 0, 0);
 
   mutt_sig_allow_interrupt(1);
   if (a->encoding == ENC_QUOTED_PRINTABLE)
-    encode_quoted(fc, f, write_as_text_part(a));
+    encode_quoted(fc, fp, write_as_text_part(a));
   else if (a->encoding == ENC_BASE64)
-    encode_base64(fc, f, write_as_text_part(a));
+    encode_base64(fc, fp, write_as_text_part(a));
   else if (a->type == TYPE_TEXT && (!a->noconv))
-    encode_8bit(fc, f);
+    encode_8bit(fc, fp);
   else
-    mutt_file_copy_stream(fpin, f);
+    mutt_file_copy_stream(fp_in, fp);
   mutt_sig_allow_interrupt(0);
 
   mutt_ch_fgetconv_close(&fc);
-  mutt_file_fclose(&fpin);
+  mutt_file_fclose(&fp_in);
 
   if (SigInt == 1)
   {
     SigInt = 0;
     return -1;
   }
-  return ferror(f) ? -1 : 0;
+  return ferror(fp) ? -1 : 0;
 }
 
 /**
@@ -724,7 +725,7 @@ static void update_content_info(struct Content *info, struct ContentState *s,
 
 /**
  * convert_file_to - Change the encoding of a file
- * @param[in]  file       File to convert
+ * @param[in]  fp         File to convert
  * @param[in]  fromcode   Original encoding
  * @param[in]  ncodes     Number of target encodings
  * @param[in]  tocodes    List of target encodings
@@ -747,7 +748,7 @@ static void update_content_info(struct Content *info, struct ContentState *s,
  * long as the input for any pair of charsets we might be interested
  * in.
  */
-static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes,
+static size_t convert_file_to(FILE *fp, const char *fromcode, int ncodes,
                               const char **tocodes, int *tocode, struct Content *info)
 {
   char bufi[256], bufu[512], bufo[4 * sizeof(bufi)];
@@ -774,12 +775,12 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes,
     }
   }
 
-  rewind(file);
+  rewind(fp);
   size_t ibl = 0;
   while (true)
   {
     /* Try to fill input buffer */
-    size_t n = fread(bufi + ibl, 1, sizeof(bufi) - ibl, file);
+    size_t n = fread(bufi + ibl, 1, sizeof(bufi) - ibl, fp);
     ibl += n;
 
     /* Convert to UTF-8 */
@@ -881,7 +882,7 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes,
 
 /**
  * convert_file_from_to - Convert a file between encodings
- * @param[in]  file      File to read from
+ * @param[in]  fp        File to read from
  * @param[in]  fromcodes Charsets to try converting FROM
  * @param[in]  tocodes   Charsets to try converting TO
  * @param[out] fromcode  From charset selected
@@ -900,7 +901,7 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes,
  * However, if fromcode is zero then fromcodes is assumed to be the name of a
  * single charset even if it contains a colon.
  */
-static size_t convert_file_from_to(FILE *file, const char *fromcodes, const char *tocodes,
+static size_t convert_file_from_to(FILE *fp, const char *fromcodes, const char *tocodes,
                                    char **fromcode, char **tocode, struct Content *info)
 {
   char *fcode = NULL;
@@ -940,7 +941,7 @@ static size_t convert_file_from_to(FILE *file, const char *fromcodes, const char
         continue;
       fcode = mutt_str_substr_dup(c, c1);
 
-      ret = convert_file_to(file, fcode, ncodes, (const char **) tcode, &cn, info);
+      ret = convert_file_to(fp, fcode, ncodes, (const char **) tcode, &cn, info);
       if (ret != (size_t)(-1))
       {
         *fromcode = fcode;
@@ -954,7 +955,7 @@ static size_t convert_file_from_to(FILE *file, const char *fromcodes, const char
   else
   {
     /* There is only one fromcode */
-    ret = convert_file_to(file, fromcodes, ncodes, (const char **) tcode, &cn, info);
+    ret = convert_file_to(fp, fromcodes, ncodes, (const char **) tcode, &cn, info);
     if (ret != (size_t)(-1))
     {
       *tocode = tcode[cn];
@@ -1071,7 +1072,7 @@ struct Content *mutt_get_content_info(const char *fname, struct Body *b)
  */
 int mutt_lookup_mime_type(struct Body *att, const char *path)
 {
-  FILE *f = NULL;
+  FILE *fp = NULL;
   char *p = NULL, *q = NULL, *ct = NULL;
   char buf[PATH_MAX];
   char subtype[256], xtype[256];
@@ -1112,12 +1113,12 @@ int mutt_lookup_mime_type(struct Body *att, const char *path)
         goto bye; /* shouldn't happen */
     }
 
-    f = fopen(buf, "r");
-    if (f)
+    fp = fopen(buf, "r");
+    if (fp)
     {
       found_mimetypes = true;
 
-      while (fgets(buf, sizeof(buf) - 1, f))
+      while (fgets(buf, sizeof(buf) - 1, fp))
       {
         /* weed out any comments */
         p = strchr(buf, '#');
@@ -1168,7 +1169,7 @@ int mutt_lookup_mime_type(struct Body *att, const char *path)
           p = NULL;
         }
       }
-      mutt_file_fclose(&f);
+      mutt_file_fclose(&fp);
     }
   }
 
@@ -1193,9 +1194,9 @@ bye:
 /**
  * transform_to_7bit - Convert MIME parts to 7-bit
  * @param a    Body of the email
- * @param fpin File to read
+ * @param fp_in File to read
  */
-static void transform_to_7bit(struct Body *a, FILE *fpin)
+static void transform_to_7bit(struct Body *a, FILE *fp_in)
 {
   char buf[PATH_MAX];
   struct State s = { 0 };
@@ -1208,11 +1209,11 @@ static void transform_to_7bit(struct Body *a, FILE *fpin)
       if (a->encoding != ENC_7BIT)
         a->encoding = ENC_7BIT;
 
-      transform_to_7bit(a->parts, fpin);
+      transform_to_7bit(a->parts, fp_in);
     }
     else if (mutt_is_message_type(a->type, a->subtype))
     {
-      mutt_message_to_7bit(a, fpin);
+      mutt_message_to_7bit(a, fp_in);
     }
     else
     {
@@ -1226,7 +1227,7 @@ static void transform_to_7bit(struct Body *a, FILE *fpin)
         mutt_perror("fopen");
         return;
       }
-      s.fp_in = fpin;
+      s.fp_in = fp_in;
       mutt_decode_attachment(a, &s);
       mutt_file_fclose(&s.fp_out);
       FREE(&a->d_filename);
@@ -1258,13 +1259,13 @@ void mutt_message_to_7bit(struct Body *a, FILE *fp)
 {
   char temp[PATH_MAX];
   char *line = NULL;
-  FILE *fpin = NULL;
-  FILE *fpout = NULL;
+  FILE *fp_in = NULL;
+  FILE *fp_out = NULL;
   struct stat sb;
 
   if (!a->filename && fp)
-    fpin = fp;
-  else if (!a->filename || !(fpin = fopen(a->filename, "r")))
+    fp_in = fp;
+  else if (!a->filename || !(fp_in = fopen(a->filename, "r")))
   {
     mutt_error(_("Could not open %s"), a->filename ? a->filename : "(null)");
     return;
@@ -1275,42 +1276,42 @@ void mutt_message_to_7bit(struct Body *a, FILE *fp)
     if (stat(a->filename, &sb) == -1)
     {
       mutt_perror("stat");
-      mutt_file_fclose(&fpin);
+      mutt_file_fclose(&fp_in);
     }
     a->length = sb.st_size;
   }
 
   mutt_mktemp(temp, sizeof(temp));
-  fpout = mutt_file_fopen(temp, "w+");
-  if (!fpout)
+  fp_out = mutt_file_fopen(temp, "w+");
+  if (!fp_out)
   {
     mutt_perror("fopen");
     goto cleanup;
   }
 
-  if (!fpin)
+  if (!fp_in)
     goto cleanup;
 
-  fseeko(fpin, a->offset, SEEK_SET);
-  a->parts = mutt_rfc822_parse_message(fpin, a);
+  fseeko(fp_in, a->offset, SEEK_SET);
+  a->parts = mutt_rfc822_parse_message(fp_in, a);
 
-  transform_to_7bit(a->parts, fpin);
+  transform_to_7bit(a->parts, fp_in);
 
-  mutt_copy_hdr(fpin, fpout, a->offset, a->offset + a->length,
+  mutt_copy_hdr(fp_in, fp_out, a->offset, a->offset + a->length,
                 CH_MIME | CH_NONEWLINE | CH_XMIT, NULL);
 
-  fputs("MIME-Version: 1.0\n", fpout);
-  mutt_write_mime_header(a->parts, fpout);
-  fputc('\n', fpout);
-  mutt_write_mime_body(a->parts, fpout);
+  fputs("MIME-Version: 1.0\n", fp_out);
+  mutt_write_mime_header(a->parts, fp_out);
+  fputc('\n', fp_out);
+  mutt_write_mime_body(a->parts, fp_out);
 
 cleanup:
   FREE(&line);
 
-  if (fpin && fpin != fp)
-    mutt_file_fclose(&fpin);
-  if (fpout)
-    mutt_file_fclose(&fpout);
+  if (fp_in && fp_in != fp)
+    mutt_file_fclose(&fp_in);
+  if (fp_out)
+    mutt_file_fclose(&fp_out);
   else
     return;
 
@@ -1557,7 +1558,7 @@ struct Body *mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool a
  */
 static void run_mime_type_query(struct Body *att)
 {
-  FILE *fp, *fperr;
+  FILE *fp, *fp_err;
   char cmd[STR_COMMAND];
   char *buf = NULL;
   size_t buflen;
@@ -1566,7 +1567,7 @@ static void run_mime_type_query(struct Body *att)
 
   mutt_file_expand_fmt_quote(cmd, sizeof(cmd), C_MimeTypeQueryCommand, att->filename);
 
-  pid = mutt_create_filter(cmd, NULL, &fp, &fperr);
+  pid = mutt_create_filter(cmd, NULL, &fp, &fp_err);
   if (pid < 0)
   {
     mutt_error(_("Error running \"%s\""), cmd);
@@ -1582,7 +1583,7 @@ static void run_mime_type_query(struct Body *att)
   }
 
   mutt_file_fclose(&fp);
-  mutt_file_fclose(&fperr);
+  mutt_file_fclose(&fp_err);
   mutt_wait_filter(pid);
 }
 
@@ -1783,13 +1784,13 @@ void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool d
 /**
  * mutt_write_references - Add the message references to a list
  * @param r    String List of references
- * @param f    File to write to
+ * @param fp   File to write to
  * @param trim Trim the list to at most this many items
  *
  * Write the list in reverse because they are stored in reverse order when
  * parsed to speed up threading.
  */
-void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim)
+void mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim)
 {
   struct ListNode *np = NULL;
   size_t length = 0;
@@ -1813,10 +1814,10 @@ void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim)
 
   for (size_t i = 0; i < length; ++i)
   {
-    fputc(' ', f);
-    fputs(ref[i]->data, f);
+    fputc(' ', fp);
+    fputs(ref[i]->data, fp);
     if (i != length - 1)
-      fputc('\n', f);
+      fputc('\n', fp);
   }
 
   FREE(&ref);
@@ -2966,8 +2967,8 @@ static int bounce_message(FILE *fp, struct Email *e, struct Address *to,
   char tempfile[PATH_MAX];
 
   mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *f = mutt_file_fopen(tempfile, "w");
-  if (f)
+  FILE *fp_tmp = mutt_file_fopen(tempfile, "w");
+  if (fp_tmp)
   {
     char date[128];
     CopyHeaderFlags chflags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
@@ -2976,17 +2977,17 @@ static int bounce_message(FILE *fp, struct Email *e, struct Address *to,
       chflags |= CH_WEED_DELIVERED;
 
     fseeko(fp, e->offset, SEEK_SET);
-    fprintf(f, "Resent-From: %s", resent_from);
-    fprintf(f, "\nResent-%s", mutt_date_make_date(date, sizeof(date)));
+    fprintf(fp_tmp, "Resent-From: %s", resent_from);
+    fprintf(fp_tmp, "\nResent-%s", mutt_date_make_date(date, sizeof(date)));
     char *msgid_str = gen_msgid();
-    fprintf(f, "Resent-Message-ID: %s\n", msgid_str);
+    fprintf(fp_tmp, "Resent-Message-ID: %s\n", msgid_str);
     FREE(&msgid_str);
-    fputs("Resent-To: ", f);
-    mutt_write_address_list(to, f, 11, 0);
-    mutt_copy_header(fp, e, f, chflags, NULL);
-    fputc('\n', f);
-    mutt_file_copy_bytes(fp, f, e->content->length);
-    if (mutt_file_fclose(&f) != 0)
+    fputs("Resent-To: ", fp_tmp);
+    mutt_write_address_list(to, fp_tmp, 11, 0);
+    mutt_copy_header(fp, e, fp_tmp, chflags, NULL);
+    fputc('\n', fp_tmp);
+    mutt_file_copy_bytes(fp, fp_tmp, e->content->length);
+    if (mutt_file_fclose(&fp_tmp) != 0)
     {
       mutt_perror(tempfile);
       unlink(tempfile);
@@ -3149,7 +3150,7 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
 {
   struct Message *msg = NULL;
   char tempfile[PATH_MAX];
-  FILE *tempfp = NULL;
+  FILE *fp_tmp = NULL;
   int rc = -1;
   bool need_mailbox_cleanup = false;
   struct stat st;
@@ -3177,8 +3178,8 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
   if ((ctx_fcc->mailbox->magic == MUTT_MMDF) || (ctx_fcc->mailbox->magic == MUTT_MBOX))
   {
     mutt_mktemp(tempfile, sizeof(tempfile));
-    tempfp = mutt_file_fopen(tempfile, "w+");
-    if (!tempfp)
+    fp_tmp = mutt_file_fopen(tempfile, "w+");
+    if (!fp_tmp)
     {
       mutt_perror(tempfile);
       mx_mbox_close(&ctx_fcc);
@@ -3196,7 +3197,7 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
   msg = mx_msg_open_new(ctx_fcc->mailbox, e, onm_flags);
   if (!msg)
   {
-    mutt_file_fclose(&tempfp);
+    mutt_file_fclose(&fp_tmp);
     mx_mbox_close(&ctx_fcc);
     goto done;
   }
@@ -3291,29 +3292,29 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
   }
 #endif
 
-  if (tempfp)
+  if (fp_tmp)
   {
     char sasha[1024];
     int lines = 0;
 
-    mutt_write_mime_body(e->content, tempfp);
+    mutt_write_mime_body(e->content, fp_tmp);
 
     /* make sure the last line ends with a newline.  Emacs doesn't ensure
      * this will happen, and it can cause problems parsing the mailbox
      * later.
      */
-    fseek(tempfp, -1, SEEK_END);
-    if (fgetc(tempfp) != '\n')
+    fseek(fp_tmp, -1, SEEK_END);
+    if (fgetc(fp_tmp) != '\n')
     {
-      fseek(tempfp, 0, SEEK_END);
-      fputc('\n', tempfp);
+      fseek(fp_tmp, 0, SEEK_END);
+      fputc('\n', fp_tmp);
     }
 
-    fflush(tempfp);
-    if (ferror(tempfp))
+    fflush(fp_tmp);
+    if (ferror(fp_tmp))
     {
       mutt_debug(LL_DEBUG1, "%s: write failed.\n", tempfile);
-      mutt_file_fclose(&tempfp);
+      mutt_file_fclose(&fp_tmp);
       unlink(tempfile);
       mx_msg_commit(ctx_fcc->mailbox, msg); /* XXX really? */
       mx_msg_close(ctx_fcc->mailbox, &msg);
@@ -3322,16 +3323,16 @@ int mutt_write_fcc(const char *path, struct Email *e, const char *msgid,
     }
 
     /* count the number of lines */
-    rewind(tempfp);
-    while (fgets(sasha, sizeof(sasha), tempfp))
+    rewind(fp_tmp);
+    while (fgets(sasha, sizeof(sasha), fp_tmp))
       lines++;
-    fprintf(msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftello(tempfp));
+    fprintf(msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftello(fp_tmp));
     fprintf(msg->fp, "Lines: %d\n\n", lines);
 
     /* copy the body and clean up */
-    rewind(tempfp);
-    rc = mutt_file_copy_stream(tempfp, msg->fp);
-    if (fclose(tempfp) != 0)
+    rewind(fp_tmp);
+    rc = mutt_file_copy_stream(fp_tmp, msg->fp);
+    if (fclose(fp_tmp) != 0)
       rc = -1;
     /* if there was an error, leave the temp version */
     if (!rc)
index de9b9b92c61818d8f8eba5b59c34772bf64c9efc..38fe16f9b2caa7f6731929c6554f1e9488274149 100644 (file)
--- a/sendlib.h
+++ b/sendlib.h
@@ -85,10 +85,10 @@ void            mutt_unprepare_envelope(struct Envelope *env);
 void            mutt_update_encoding(struct Body *a);
 void            mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
 int             mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath);
-int             mutt_write_mime_body(struct Body *a, FILE *f);
-int             mutt_write_mime_header(struct Body *a, FILE *f);
+int             mutt_write_mime_body(struct Body *a, FILE *fp);
+int             mutt_write_mime_header(struct Body *a, FILE *fp);
 int             mutt_write_multiple_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath);
 int             mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, CopyHeaderFlags chflags);
-void            mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);
+void            mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim);
 
 #endif /* MUTT_SENDLIB_H */