]> granicus.if.org Git - mutt/commitdiff
Catch another error condition which may be caused by a broken
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Sep 2000 14:28:35 +0000 (14:28 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Sep 2000 14:28:35 +0000 (14:28 +0000)
nl_langinfo() function.

charset.c

index 059e523f05b6405087975f9ea705c77a1787ee61..0f2984c9a9c3e26f112476285fd4ab436e6a2f4c 100644 (file)
--- 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));