summaryrefslogtreecommitdiffstats
path: root/charset.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-09-27 14:28:35 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-09-27 14:28:35 +0000
commitf9cf6f5528b339b875aec879528a7daffa13219b (patch)
treef8b5074f59973d4a80c8ad91c2950749b08eb820 /charset.c
parent50ae56c32359cd9ab371a9db70a84c3e09155e0c (diff)
Catch another error condition which may be caused by a broken
nl_langinfo() function.
Diffstat (limited to 'charset.c')
-rw-r--r--charset.c7
1 files changed, 5 insertions, 2 deletions
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));