- move version string creation to central place + update all others
- drop ~/.muttngrc-$version and ~/.muttng/muttngrc-$version as it doesn't make sense without a version released so far
- add one more pop magic number to some switch statement (just disables warning; not really sure if this is really correct)
- as NNTP currently doubles some functionality from mutt_parse_rfc822_line(), copy bug "fix": copy complete From: line even if address is invalid to show at least _something_; this is required for some non de.ALL newsgroups ;-((((
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@420
e385b8ad-14ed-0310-8656-
cc95a2468c6d
12 files changed:
the necessary keywords to look them up in the manual, ChangeLog or other
sources of information.
the necessary keywords to look them up in the manual, ChangeLog or other
sources of information.
+2005-08-22:
+
+ Reading configurations from ~/.muttngrc-$version and
+ ~/.muttng/muttngrc-$version is no longer supported;
+ ~/.muttngrc and ~/.muttng/muttngrc remain.
+
2005-08-18:
The $max_display_recips option has been added.
2005-08-18:
The $max_display_recips option has been added.
void mutt_version (void)
{
void mutt_version (void)
{
- mutt_message (mutt_make_version ());
+ mutt_message (mutt_make_version (1));
}
void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp)
}
void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp)
- snprintf (fmt, sizeof (fmt), "Mutt-ng %%s");
- snprintf (buf, buflen, fmt, MUTT_VERSION);
+ strncpy (buf, mutt_make_version (0), buflen);
snprintf (buffer, sizeof (buffer), "%s/.muttngrc-%s", NONULL (Homedir),
MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttngrc-%s", NONULL (Homedir),
MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttngrc", NONULL (Homedir));
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttngrc", NONULL (Homedir));
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttng/muttngrc-%s",
NONULL (Homedir), MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttng/muttngrc-%s",
NONULL (Homedir), MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttng/muttngrc",
NONULL (Homedir));
snprintf (buffer, sizeof (buffer), "%s/.muttng/muttngrc",
NONULL (Homedir));
static void mutt_usage (void)
{
static void mutt_usage (void)
{
- puts (mutt_make_version ());
+ puts (mutt_make_version (1));
- puts (mutt_make_version ());
+ puts (mutt_make_version (1));
puts (_(Notice));
uname (&uts);
puts (_(Notice));
uname (&uts);
show_version ();
break;
default:
show_version ();
break;
default:
- puts (mutt_make_version ());
+ puts (mutt_make_version (1));
puts (_(Copyright));
puts (_(ReachingUs));
exit (0);
puts (_(Copyright));
puts (_(ReachingUs));
exit (0);
-const char *mutt_make_version (void)
+const char *mutt_make_version (int full)
{
static char vstring[STRING];
{
static char vstring[STRING];
- snprintf (vstring, sizeof (vstring), "Mutt-ng %s-%s (based on Mutt 1.5.10/%s)",
- MUTT_VERSION, MUTTNG_SVNREV, ReleaseDate);
+ if (full)
+ snprintf (vstring, sizeof (vstring), "Mutt-ng %s-%s (based "
+ "on Mutt 1.5.10/%s)", MUTT_VERSION, MUTTNG_SVNREV,
+ ReleaseDate);
+ else
+ snprintf (vstring, sizeof (vstring), "mutt-ng/%s-%s",
+ MUTT_VERSION, MUTTNG_SVNREV);
rfc822_free_address (&hdr->env->from);
hdr->env->from = rfc822_parse_adrlist (hdr->env->from, b);
rfc2047_decode_adrlist (hdr->env->from);
rfc822_free_address (&hdr->env->from);
hdr->env->from = rfc822_parse_adrlist (hdr->env->from, b);
rfc2047_decode_adrlist (hdr->env->from);
+ /* same as for mutt_parse_rfc822_line():
+ * don't leave from info NULL if there's an invalid address (or
+ * whatever) in From: field; mutt would just display it as empty
+ * and mark mail/(esp.) news article as your own. aaargh! this
+ * bothered me for _years_ */
+ if (!hdr->env->from) {
+ hdr->env->from = rfc822_new_address ();
+ hdr->env->from->personal = str_dup (b);
+ }
break;
case 3:
hdr->date_sent = mutt_parse_date (b, hdr);
break;
case 3:
hdr->date_sent = mutt_parse_date (b, hdr);
* bothered me for _years_ */
if (!e->from) {
e->from = rfc822_new_address ();
* bothered me for _years_ */
if (!e->from) {
e->from = rfc822_new_address ();
- e->from->personal = str_dup (line + 6);
+ e->from->personal = str_dup (p);
pop_data->cmd_capa = CMD_AVAILABLE;
break;
}
pop_data->cmd_capa = CMD_AVAILABLE;
break;
}
case PQ_ERR:
{
pop_data->cmd_capa = CMD_NOT_AVAILABLE;
case PQ_ERR:
{
pop_data->cmd_capa = CMD_NOT_AVAILABLE;
char *mutt_crypt_hook (ADDRESS *);
char *mutt_make_date (char *, size_t);
char *mutt_crypt_hook (ADDRESS *);
char *mutt_make_date (char *, size_t);
-const char *mutt_make_version (void);
+const char *mutt_make_version (int full);
const char *mutt_fqdn (short);
const char *mutt_fqdn (short);
#include "charset.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
#include "charset.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
#include "lib/mem.h"
#include "lib/str.h"
#include "lib/mem.h"
#include "lib/str.h"
}
}
/* Add a vanity header */
}
}
/* Add a vanity header */
- fprintf (fp, "User-Agent: mutt-ng/%s (%s)\n", MUTT_VERSION, os);
+ fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version (0), os);
}
return (ferror (fp) == 0 ? 0 : -1);
}
return (ferror (fp) == 0 ? 0 : -1);
- snprintf (fmt, sizeof (fmt), "Mutt-ng %%s");
- snprintf (buf, buflen, fmt, MUTT_VERSION);
+ strncpy (buf, mutt_make_version (0), buflen);