diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-16 16:10:05 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-16 16:10:05 +0000 |
commit | 7639ef4c8ace8948ec5ce3baad9dbe9103f64c89 (patch) | |
tree | 88eec660ccd05f9f0851a624a8c9ce9c1c1e72db /init.c | |
parent | 54de007bacd09934fbbb23bdb6320ef33593ff31 (diff) |
Use nl_langinfo's return value as the default for $charset.
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -51,6 +51,10 @@ #include <errno.h> #include <sys/wait.h> +#ifdef HAVE_LANGINFO_CODESET +#include <langinfo.h> +#endif + void toggle_quadoption (int opt) { int n = opt/4; @@ -919,7 +923,8 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) else if (DTYPE (MuttVars[idx].type) == DT_STR) { *((char **) MuttVars[idx].data) = safe_strdup (tmp->data); - mutt_set_charset (Charset); + if (mutt_strcmp (MuttVars[idx].option, "charset") == 0) + mutt_set_charset (Charset); } else { @@ -1809,6 +1814,15 @@ void mutt_init (int skip_sys_rc, LIST *commands) FREE (&token.data); } +#ifdef HAVE_LANGINFO_CODESET + Charset = safe_strdup (nl_langinfo (CODESET)); +#else + Charset = safe_strdup ("iso-8859-1"); +#endif + + mutt_set_charset (Charset); + + /* Set standard defaults */ for (i = 0; MuttVars[i].option; i++) { @@ -1818,6 +1832,7 @@ void mutt_init (int skip_sys_rc, LIST *commands) CurrentMenu = MENU_MAIN; + #ifndef LOCALES_HACK /* Do we have a locale definition? */ if (((p = getenv ("LC_ALL")) != NULL && p[0]) || |