Merge branch 'master' into nohook
authorPierre Habouzit <madcoder@debian.org>
Sun, 18 Nov 2007 12:31:56 +0000 (13:31 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 18 Nov 2007 12:31:56 +0000 (13:31 +0100)
15 files changed:
OPS
commands.c
compose.c
crypt.cpkg
functions.def
lib-mx/mx.c
lib-ui/curs_main.c
lib-ui/status.c
main.c
mutt.h
muttlib.c
pager.c
protos.h
send.c
sendlib.c

diff --git a/OPS b/OPS
index 17c04a0..2884dce 100644 (file)
--- a/OPS
+++ b/OPS
@@ -171,7 +171,6 @@ OP_TOP_PAGE "move to the top of the page"
 OP_UNDELETE "undelete the current entry"
 OP_UNDELETE_THREAD "undelete all messages in thread"
 OP_UNDELETE_SUBTHREAD "undelete all messages in subthread"
-OP_VERSION "show the Mutt version number and date"
 OP_VIEW_ATTACH "view attachment using mailcap entry if necessary"
 OP_VIEW_ATTACHMENTS "show MIME attachments"
 OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
index 710fd7b..239c7ea 100644 (file)
@@ -699,11 +699,6 @@ int mutt_save_message (HEADER * h, int delete,
   return -1;
 }
 
-void mutt_version (void)
-{
-  mutt_message (mutt_make_version());
-}
-
 void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp)
 {
   char buf[LONG_STRING];
index 5b55a8d..b6677d4 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -343,7 +343,7 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op,
     break;
 
   case 'v':
-    m_strcpy(buf, buflen, mutt_make_version());
+    m_strcpy(buf, buflen, madmutt_version);
     break;
 
   case 0:
index 0dded60..f8fce19 100644 (file)
@@ -326,7 +326,7 @@ static gpgme_ctx_t create_gpgme_context(int for_smime)
     if (err) {
         mutt_error(_("error creating gpgme context: %s\n"),
                    gpgme_strerror(err));
-        sleep(2);
+        mutt_sleep(2);
         mutt_exit(1);
     }
     if (!for_smime)
@@ -335,7 +335,7 @@ static gpgme_ctx_t create_gpgme_context(int for_smime)
     err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
     if (err) {
         mutt_error(_("error enabling CMS protocol: %s\n"), gpgme_strerror(err));
-        sleep(2);
+        mutt_sleep(2);
         mutt_exit(1);
     }
     return ctx;
@@ -352,7 +352,7 @@ static gpgme_data_t create_gpgme_data(void)
     if (err) {
         mutt_error(_("error creating gpgme data object: %s\n"),
                    gpgme_strerror(err));
-        sleep(2);
+        mutt_sleep(2);
         mutt_exit(1);
     }
     return data;
index f95bc49..71df4bb 100644 (file)
@@ -140,7 +140,6 @@ LIST(OpMain)
     ITEM("undelete-subthread",        OP_UNDELETE_SUBTHREAD,         "\033u")
     ITEM("undelete-thread",           OP_UNDELETE_THREAD,            "\025")
     ITEM("view-attachments",          OP_VIEW_ATTACHMENTS,           "v")
-    ITEM("show-version",              OP_VERSION,                    "V")
     ITEM("set-flag",                  OP_MAIN_SET_FLAG,              "w")
     ITEM("clear-flag",                OP_MAIN_CLEAR_FLAG,            "W")
     ITEM("toggle-read",               OP_TOGGLE_READ,                "X")
@@ -224,7 +223,6 @@ LIST(OpPager)
     ITEM("undelete-subthread",        OP_UNDELETE_SUBTHREAD,          "\033u")
     ITEM("undelete-thread",           OP_UNDELETE_THREAD,             "\025")
     ITEM("view-attachments",          OP_VIEW_ATTACHMENTS,            "v")
-    ITEM("show-version",              OP_VERSION,                     "V")
     ITEM("search-toggle",             OP_SEARCH_TOGGLE,               "\\")
     ITEM("display-address",           OP_DISPLAY_ADDRESS,             "@")
     ITEM("next-new",                  OP_MAIN_NEXT_NEW,               NULL)
index ba1cc3c..0ed8bad 100644 (file)
@@ -139,7 +139,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int time_out)
         prev_sb = sb;
 
         mutt_message (_("Waiting for fcntl lock... %d"), ++attempt);
-        sleep (1);
+        mutt_sleep (1);
     }
 #endif /* USE_FCNTL */
 
@@ -174,7 +174,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int time_out)
         prev_sb = sb;
 
         mutt_message (_("Waiting for flock attempt... %d"), ++attempt);
-        sleep (1);
+        mutt_sleep (1);
     }
 #endif /* USE_FLOCK */
 
index 26bb962..4a8a2be 100644 (file)
@@ -1928,10 +1928,6 @@ int mutt_index_menu (void)
       }
       break;
 
-    case OP_VERSION:
-      mutt_version ();
-      break;
-
     case OP_BUFFY_LIST:
       if (option (OPTFORCEBUFFYCHECK))
         buffy_check (1);
index a6f0211..b94f551 100644 (file)
@@ -253,7 +253,7 @@ status_format_str(char *buf, ssize_t buflen, char op, const char *src,
     break;
 
   case 'v':
-    m_strcpy(buf, buflen, mutt_make_version());
+    m_strcpy(buf, buflen, madmutt_version);
     break;
 
   case 'V':
diff --git a/main.c b/main.c
index 72166ea..afa5ef8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -64,7 +64,7 @@ void mutt_exit(int code)
 
 static void mutt_usage (void)
 {
-    puts(mutt_make_version());
+    puts(madmutt_version);
 
     puts(_("\
 usage: madmutt [ -nRyzZ ] [ -e <cmd> ] [ -F <file> ] [ -f <file> ]\n\
@@ -98,7 +98,7 @@ static void show_version (void)
     struct utsname uts;
     uname(&uts);
 
-    puts(mutt_make_version());
+    puts(madmutt_version);
     puts(_("  Copyright (C) 1996-2002 Michael R. Elkins and others."));
     puts(_("  Copyright (C) 2005      The Mutt-ng Team"));
     puts(_("  Copyright (C) 2006-2007 Pierre Habouzit"));
diff --git a/mutt.h b/mutt.h
index ec87e8e..21ef4a7 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -15,7 +15,7 @@
 #include <lib-mime/mime.h>
 #include <lib-lua/lib-lua.h>
 
-#define MUTT_VERSION (VERSION)
+#define MUTT_VERSION  VERSION
 
 /* nifty trick I stole from ELM 2.5alpha. */
 #ifdef MAIN_C
index fbbd6e6..1c23817 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -21,6 +21,8 @@
 #include "mutt.h"
 #include "attach.h"
 
+const char *madmutt_version = "Madmutt/" MUTT_VERSION;
+
 /* Modified by blong to accept a "suggestion" for file name.  If
  * that file exists, then construct one with unique name but 
  * keep any extension.  This might fail, I guess.
@@ -356,13 +358,6 @@ void mutt_sleep (short s)
     sleep(MAX(s, SleepTime));
 }
 
-const char *mutt_make_version(void)
-{
-  static char vstring[STRING];
-  snprintf(vstring, sizeof (vstring), "Madmutt/%s", MUTT_VERSION);
-  return vstring;
-}
-
 /* return 1 if address lists are strictly identical */
 static int mutt_cmp_addr (const address_t * a, const address_t * b)
 {
diff --git a/pager.c b/pager.c
index f6ec60e..3bed820 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2202,10 +2202,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       }
       break;
 
-    case OP_VERSION:
-      mutt_version ();
-      break;
-
     case OP_BUFFY_LIST:
       if (option (OPTFORCEBUFFYCHECK))
         buffy_check (1);
index 8677928..dec0ccf 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -7,6 +7,7 @@
  * please see the file GPL in the top level source directory.
  */
 
+extern const char *madmutt_version;
 
 /* use the m_temp{fd,file} functions instead */
 void mutt_adv_mktemp (const char*, char*, ssize_t) __attribute__((deprecated));
@@ -41,8 +42,6 @@ char *mutt_get_body_charset (char *, ssize_t, BODY *);
 const char *mutt_get_name (address_t *);
 char *mutt_make_date (char *, ssize_t);
 
-const char *mutt_make_version(void);
-
 const char *mutt_fqdn (short);
 
 void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
@@ -82,7 +81,6 @@ void mutt_shell_escape (void);
 void mutt_stamp_attachment (BODY * a);
 void mutt_tag_set_flag (int, int);
 void mutt_update_encoding (BODY * a);
-void mutt_version (void);
 void mutt_write_references (string_list_t *, FILE *);
 void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
                               int display);
diff --git a/send.c b/send.c
index c29ffb6..d077993 100644 (file)
--- a/send.c
+++ b/send.c
@@ -274,7 +274,7 @@ static int edit_envelope (ENVELOPE * en, int flags)
     }
     else {
       mutt_error (_("Ignoring $strip_was: Subject would be empty."));
-      sleep (2);
+      mutt_sleep (2);
     }
   }
   if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) != 0 || (!buf[0]
@@ -1439,7 +1439,7 @@ int ci_send_message (int flags, /* send mode */
     if (quadoption (OPT_ATTACH) == M_YES) {
       mutt_message _("No attachments made but indicator found in text. "
                      "Abort sending.");
-      sleep (2);
+      mutt_sleep (2);
     }
     mutt_message (_("Mail not sent."));
     goto main_loop;
index 33129ed..1f15e17 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1438,10 +1438,10 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach,
 
   if (mode == 0 && option (OPTXMAILER) && !has_agent) {
     if (mod_core.operating_system) {
-      fprintf(fp, "User-Agent: %s (%s)\n", mutt_make_version(),
+      fprintf(fp, "User-Agent: %s (%s)\n", madmutt_version,
               mod_core.operating_system);
     } else {
-      fprintf(fp, "User-Agent: %s\n", mutt_make_version());
+      fprintf(fp, "User-Agent: %s\n", madmutt_version);
     }
   }