]> granicus.if.org Git - neomutt/commitdiff
Make IDN decoding optional.
authorTAKAHASHI Tamotsu <tamo@momonga-linux.org>
Tue, 8 Feb 2005 17:23:50 +0000 (17:23 +0000)
committerTAKAHASHI Tamotsu <tamo@momonga-linux.org>
Tue, 8 Feb 2005 17:23:50 +0000 (17:23 +0000)
init.h
mutt.h
mutt_idna.c

diff --git a/init.h b/init.h
index a8e87c4b9481976a610506335ea957e6dc891a38..fa1f0e0e749c4090ccacae816827e28f35cddf06 100644 (file)
--- a/init.h
+++ b/init.h
@@ -2712,6 +2712,15 @@ struct option_t MuttVars[] = {
   ** generated unless the user explicitly sets one using the ``$my_hdr''
   ** command.
   */
+#ifdef HAVE_LIBIDN
+  { "use_idn",         DT_BOOL, R_BOTH, OPTUSEIDN, 1},
+  /*
+  ** .pp
+  ** When \fIset\fP, Mutt will show you international domain names decoded.
+  ** Note: You can use IDNs for addresses even if this is \fIunset\fP.
+  ** This variable only affects decoding.
+  */
+#endif /* HAVE_LIBIDN */
 #ifdef HAVE_GETADDRINFO
   { "use_ipv6",                DT_BOOL, R_NONE, OPTUSEIPV6, 1},
   /*
diff --git a/mutt.h b/mutt.h
index 297009c085d947a9af0970efaff7b1186a99c3f3..ac80b43dc2f79f3ba1bcd5d54c4fc5a5b5582a47 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -430,6 +430,9 @@ enum
   OPTUSEDOMAIN,
   OPTUSEFROM,
   OPTUSEGPGAGENT,
+#ifdef HAVE_LIBIDN
+  OPTUSEIDN,
+#endif
 #ifdef HAVE_GETADDRINFO
   OPTUSEIPV6,
 #endif
index 2cfecf239376b73ef34e2fb69844aab12be2dc4e..bc7a976a2736fd8b36fa26badbd5305a80857c79 100644 (file)
@@ -46,6 +46,9 @@ int mutt_idna_to_local (const char *in, char **out, int flags)
 {
   *out = NULL;
 
+  if (!option (OPTUSEIDN))
+    goto notrans;
+
   if (!in)
     goto notrans;
   
@@ -57,7 +60,8 @@ int mutt_idna_to_local (const char *in, char **out, int flags)
 
   /* 
    * make sure that we can convert back and come out with the same
-   * domain name. */
+   * domain name. 
+   */
   
   if ((flags & MI_MAY_BE_IRREVERSIBLE) == 0)
   {