From 50e7679dd16170d715accdb645258f87777167dd Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 18 Nov 2007 13:31:42 +0100 Subject: [PATCH] We don't need a function for mutt_make_version(). Signed-off-by: Pierre Habouzit --- compose.c | 2 +- lib-ui/status.c | 2 +- main.c | 4 ++-- mutt.h | 2 +- muttlib.c | 9 ++------- protos.h | 3 +-- sendlib.c | 4 ++-- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/compose.c b/compose.c index 5b55a8d..b6677d4 100644 --- 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: diff --git a/lib-ui/status.c b/lib-ui/status.c index a6f0211..b94f551 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -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 --- 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 ] [ -F ] [ -f ]\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 --- a/mutt.h +++ b/mutt.h @@ -15,7 +15,7 @@ #include #include -#define MUTT_VERSION (VERSION) +#define MUTT_VERSION VERSION /* nifty trick I stole from ELM 2.5alpha. */ #ifdef MAIN_C diff --git a/muttlib.c b/muttlib.c index fbbd6e6..1c23817 100644 --- 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/protos.h b/protos.h index 2553cc8..560a1b2 100644 --- 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)); @@ -43,8 +44,6 @@ const char *mutt_get_name (address_t *); const char *mutt_crypt_hook (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, diff --git a/sendlib.c b/sendlib.c index 33129ed..1f15e17 100644 --- 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); } } -- 2.20.1