small touchups
authorPierre Habouzit <madcoder@debian.org>
Thu, 29 Mar 2007 22:08:53 +0000 (00:08 +0200)
committerPierre Habouzit <madcoder@debian.org>
Thu, 29 Mar 2007 22:08:53 +0000 (00:08 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
charset.cpkg

index f491e05..42eba4d 100644 (file)
@@ -209,8 +209,8 @@ int charset_is_us_ascii(const char *s)
 /* Like iconv_open, but canonicalises the charsets */
 iconv_t mutt_iconv_open(const char *tocode, const char *fromcode, int flags)
 {
-    char to1[STRING];
-    char from1[STRING];
+    char to1[STRING],   to2[STRING];
+    char from1[STRING], from2[STRING];
     char tmp[STRING];
     iconv_t cd;
 
@@ -231,14 +231,10 @@ iconv_t mutt_iconv_open(const char *tocode, const char *fromcode, int flags)
     if ((cd = iconv_open(to1, from1)) != MUTT_ICONV_ERROR)
         return cd;
 
-    {
-        char to2[STRING];
-        char from2[STRING];
+    if (rx_list_match2(iconv_hooks, to1, to2, sizeof(to2))
+    &&  rx_list_match2(iconv_hooks, from1, from2, sizeof(from2)))
+        return iconv_open(to2, from2);
 
-        if (rx_list_match2(iconv_hooks, to1, to2, sizeof(to2))
-        &&  rx_list_match2(iconv_hooks, from1, from2, sizeof(from2)))
-            return iconv_open(to2, from2);
-    }
     return MUTT_ICONV_ERROR;
 }