From: Thomas Roessler Date: Wed, 27 Sep 2000 14:28:35 +0000 (+0000) Subject: Catch another error condition which may be caused by a broken X-Git-Tag: mutt-1-3-10-rel~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9cf6f5528b339b875aec879528a7daffa13219b;p=mutt Catch another error condition which may be caused by a broken nl_langinfo() function. --- diff --git a/charset.c b/charset.c index 059e523f..0f2984c9 100644 --- a/charset.c +++ b/charset.c @@ -200,7 +200,8 @@ void mutt_set_langinfo_charset (void) mutt_canonical_charset (buff2, sizeof (buff2), buff); /* finally, set $charset */ - Charset = safe_strdup (buff); + if (!(Charset = safe_strdup (buff))) + Charset = safe_strdup ("iso-8859-1"); } #endif @@ -213,7 +214,9 @@ void mutt_canonical_charset (char *dest, size_t dlen, const char *name) /* catch some common iso-8859-something misspellings */ if (!mutt_strncasecmp (name, "iso8859", 7) && name[7] != '-') - snprintf (scratch, sizeof (scratch), "iso_8859-%s", name + 8); + snprintf (scratch, sizeof (scratch), "iso_8859-%s", name + 7); + else if (!mutt_strncasecmp (name, "iso8859-", 8)) + snprintf (scratch, sizeof (scratch), "iso8859-%s", name + 8); else strfcpy (scratch, NONULL(name), sizeof (scratch));