mutt_enter_string is only used for _mutt_get_field for real.
[apps/madmutt.git] / main.c
diff --git a/main.c b/main.c
index 885655a..6247429 100644 (file)
--- a/main.c
+++ b/main.c
@@ -45,10 +45,6 @@ extern int optind;
 #include <stringprep.h>
 #endif
 
-#ifdef USE_NNTP
-#include "nntp.h"
-#endif
-
 #ifdef USE_HCACHE
 #if defined(HAVE_QDBM)
 #include <depot.h>
@@ -83,10 +79,6 @@ usage: madmutt [ -nRyzZ ] [ -e <cmd> ] [ -F <file> ] [ -f <file> ]\n\
     puts(_("  -e <command>  specify a command to be executed after initialization"));
     puts(_("  -f <file>     specify which mailbox to read"));
     puts(_("  -F <file>     specify an alternate Madmuttrc file"));
-#ifdef USE_NNTP
-    puts(_("  -g <server>   specify a newsserver"));
-    puts(_("  -G            select a newsgroup"));
-#endif
     puts(_("  -H <file>     specify a draft file to read header and body from"));
     puts(_("  -i <file>     specify a file which Madmutt should include in the body"));
     puts(_("  -n            causes Madmutt not to read the system Madmuttrc"));
@@ -138,11 +130,6 @@ static void show_version (void)
     puts (_("Compile Options:"));
 
     puts (
-#ifdef USE_SETGID
-        "  +USE_SETGID"
-#else
-        "  -USE_SETGID"
-#endif
 #ifdef USE_FCNTL
         "  +USE_FCNTL"
 #else
@@ -158,11 +145,6 @@ static void show_version (void)
 #else
         "  -USE_HCACHE"
 #endif
-#ifdef USE_NNTP
-        "  +USE_NNTP"
-#else
-        "  -USE_NNTP"
-#endif
 #ifdef HAVE_LIBIDN
         "  +HAVE_LIBIDN"
 #else
@@ -185,27 +167,12 @@ static void show_version (void)
     exit(0);
 }
 
-static void start_curses (void)
-{
-  km_init ();                   /* must come before mutt_init */
-  mutt_signal_initialize ();
-  if (initscr () == NULL) {
-    puts _("Error initializing terminal.");
-
-    exit (1);
-  }
-  mutt_signal_initialize ();
-  curses_initialize();
-}
-
 #define M_IGNORE  (1<<0)        /* -z */
 #define M_BUFFY   (1<<1)        /* -Z */
 #define M_NOSYSRC (1<<2)        /* -n */
 #define M_RO      (1<<3)        /* -R */
 #define M_SELECT  (1<<4)        /* -y */
-#ifdef USE_NNTP
 #define M_NEWS    (1<<5)        /* -g and -G */
-#endif
 
 __attribute__((format(printf, 1, 0)))
 static void mutt_nocurses_error (const char *fmt, ...)
@@ -252,11 +219,7 @@ int main (int argc, char **argv)
   srand48 (time (NULL));
   umask (077);
 
-  while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvyzZ"
-#ifdef USE_NNTP
-                                                                    "g:G"
-#endif
-                    )) >= 0)
+  while ((i = getopt(argc, argv, "a:b:F:f:c:e:H:s:i:hnpRTtvyzZ")) >= 0)
     switch (i) {
     case 'a':
       if (strlen(optarg)<=512)
@@ -324,20 +287,6 @@ int main (int argc, char **argv)
       flags |= M_SELECT;
       break;
 
-#ifdef USE_NNTP
-    case 'g':                  /* Specify a newsserver */
-      {
-        char buf[LONG_STRING];
-
-        snprintf (buf, sizeof (buf), "set nntp_host=%s", optarg);
-        commands = mutt_add_list (commands, buf);
-      }
-
-    case 'G':                  /* List of newsgroups */
-      flags |= M_SELECT | M_NEWS;
-      break;
-#endif
-
     case 'z':
       flags |= M_IGNORE;
       break;
@@ -362,8 +311,11 @@ int main (int argc, char **argv)
 
   /* This must come before mutt_init() because curses needs to be started
      before calling the init_pair() function to set the color scheme.  */
-  if (!option (OPTNOCURSES))
-    start_curses();
+  if (!option (OPTNOCURSES)) {
+    km_init();
+    curses_initialize();
+    mutt_signal_initialize();
+  }
 
   /* set defaults and read init files */
   mutt_init (flags & M_NOSYSRC, commands);
@@ -528,15 +480,6 @@ int main (int argc, char **argv)
       buffy_next (folder, sizeof (folder));
     }
     else if (flags & M_SELECT) {
-#ifdef USE_NNTP
-      if (flags & M_NEWS) {
-        set_option (OPTNEWS);
-        if (!(CurrentNewsSrv = mutt_select_newsserver (NewsServer))) {
-          mutt_endwin (Errorbuf);
-          exit (1);
-        }
-      } else
-#endif
       if (!Incoming.len) {
         mutt_endwin _("No incoming mailboxes defined.");
 
@@ -554,15 +497,7 @@ int main (int argc, char **argv)
     if (!folder[0])
       m_strcpy(folder, sizeof(folder), NONULL(Spoolfile));
 
-#ifdef USE_NNTP
-    if (option (OPTNEWS)) {
-      unset_option (OPTNEWS);
-      nntp_expand_path (folder, sizeof (folder),
-                        &CurrentNewsSrv->conn->account);
-    } else
-#endif
-      mutt_expand_path (folder, sizeof (folder));
-
+    mutt_expand_path (folder, sizeof (folder));
     m_strreplace(&CurrentFolder, folder);
     m_strreplace(&LastFolder, folder);