improvements, fixes, parser progress, ...
[apps/madmutt.git] / lib-crypt / gnupgparse.c
index f2a105c..a2d8549 100644 (file)
  * 
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/date.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
+#include <lib-sys/unix.h>
+#include <lib-ui/curses.h>
 
-#include "mutt.h"
 #include "pgp.h"
 #include "charset.h"
 
-
 /****************
  * Read the GNUPG keys.  For now we read the complete keyring by
  * calling gnupg in a special mode.
@@ -81,7 +64,7 @@ static void fix_uid (char *uid)
   }
   *d = '\0';
 
-  if (_chs && (cd = mutt_iconv_open (_chs, "utf-8", 0)) != (iconv_t) - 1) {
+  if (_chs && (cd = mutt_iconv_open (_chs, "utf-8", 0)) != MUTT_ICONV_ERROR) {
     int n = s - uid + 1;        /* chars available in original buffer */
     char *buf;
     const char *ib;
@@ -327,7 +310,7 @@ pgp_key_t pgp_get_candidates (pgp_ring_t keyring, string_list_t * hints)
   if (ferror (fp))
     mutt_perror ("fgets");
 
-  fclose (fp);
+  m_fclose(&fp);
   mutt_wait_filter (thepid);
 
   close (devnull);