X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=583b02dd88c0fc7fc8c779abbcaeb0d6c17cd4f5;hp=e9e1cf67fd305d8b7b5efe68806612581ca70cde;hb=a2a7836df164f0e198ad34dbc2f82baf7847fb94;hpb=711f787502b6a1a1c150b948a5ed9156c8ef9ba1 diff --git a/init.c b/init.c index e9e1cf6..583b02d 100644 --- a/init.c +++ b/init.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -90,10 +89,6 @@ static int check_history (const char* option, unsigned long val, /* this checks that numbers are >= 0 */ static int check_num (const char* option, unsigned long val, char* errbuf, ssize_t errlen); -#ifdef DEBUG -static int check_debug (const char* option, unsigned long val, - char* errbuf, ssize_t errlen); -#endif /* use this to check only */ static int check_special (const char* option, unsigned long val, @@ -115,9 +110,6 @@ static struct { #endif { "history", check_history }, { "pager_index_lines", check_num }, -#ifdef DEBUG - { "debug_level", check_debug }, -#endif /* last */ { NULL, NULL } }; @@ -538,7 +530,6 @@ int mutt_option_value (const char* val, char* dst, ssize_t dstlen) { ssize_t l = 0; if (!(option = hash_find (ConfigOptions, val))) { - debug_print (1, ("var '%s' not found\n", val)); *dst = '\0'; return (0); } @@ -547,7 +538,6 @@ int mutt_option_value (const char* val, char* dst, ssize_t dstlen) { /* as we get things of type $var=value and don't want to bloat the * above "just" for expansion, we do the stripping here */ - debug_print (1, ("orig == '%s'\n", tmp)); t = strchr (tmp, '='); t++; l = m_strlen(t); @@ -559,7 +549,6 @@ int mutt_option_value (const char* val, char* dst, ssize_t dstlen) { } memcpy (dst, t, l+1); p_delete(&tmp); - debug_print (1, ("stripped == '%s'\n", dst)); return (1); } @@ -1099,11 +1088,8 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, string_list_t **ldata, /* Find the last item in the list that data points to. */ lastp = NULL; - debug_print (5, ("parse_attach_list: ldata = %p, *ldata = %p\n", - ldata, *ldata)); for (listp = *ldata; listp; listp = listp->next) { a = (ATTACH_MATCH *)listp->data; - debug_print (5, ("parse_attach_list: skipping %s/%s\n", a->major, a->minor)); lastp = listp; } @@ -1143,9 +1129,6 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, string_list_t **ldata, p_delete(&tmpminor); - debug_print (5, ("parse_attach_list: added %s/%s [%d]\n", - a->major, a->minor, a->major_int)); - listp = p_new(string_list_t, 1); listp->data = (char *)a; listp->next = NULL; @@ -1193,11 +1176,7 @@ static int parse_unattach_list (BUFFER *buf, BUFFER *s, string_list_t **ldata, lastp = NULL; for(lp = *ldata; lp; ) { a = (ATTACH_MATCH *)lp->data; - debug_print(5, ("parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n", - a->major, a->minor, a->major_int, tmp, minor, major)); if (a->major_int == major && !m_strcasecmp(minor, a->minor)) { - debug_print(5, ("parse_unattach_list: removed %s/%s [%d]\n", - a->major, a->minor, a->major_int)); regfree(&a->minor_rx); p_delete(&a->major); @@ -1435,8 +1414,6 @@ static int parse_alias (BUFFER * buf, BUFFER * s, mutt_extract_token (buf, s, 0); - debug_print (2, ("first token is '%s'.\n", buf->data)); - /* check to see if an alias with this name already exists */ for (; tmp; tmp = tmp->next) { if (!m_strcasecmp(tmp->name, buf->data)) @@ -1461,7 +1438,6 @@ static int parse_alias (BUFFER * buf, BUFFER * s, mutt_extract_token (buf, s, M_TOKEN_QUOTE | M_TOKEN_SPACE | M_TOKEN_SEMICOLON); - debug_print (2, ("second token is '%s'.\n", buf->data)); tmp->addr = mutt_parse_adrlist (tmp->addr, buf->data); if (last) last->next = tmp; @@ -1472,19 +1448,7 @@ static int parse_alias (BUFFER * buf, BUFFER * s, _("Warning: Bad IDN '%s' in alias '%s'.\n"), estr, tmp->name); return -1; } -#ifdef DEBUG - if (DebugLevel >= 2) { - address_t *a; - /* A group is terminated with an empty address, so check a->mailbox */ - for (a = tmp->addr; a && a->mailbox; a = a->next) { - if (!a->group) - debug_print (2, ("%s\n", a->mailbox)); - else - debug_print (2, ("group %s\n", a->mailbox)); - } - } -#endif return 0; } @@ -1620,8 +1584,6 @@ static struct option_t* add_option (const char* name, const char* init, short type, short dodup) { struct option_t* option = p_new(struct option_t, 1); - debug_print (1, ("adding $%s\n", name)); - option->option = m_strdup(name); option->type = type; if (init) @@ -1638,7 +1600,6 @@ static struct option_t* add_user_option (const char* name) { static void del_option (void* p) { struct option_t *ptr = (struct option_t*) p; char* s = (char*) ptr->data; - debug_print (1, ("removing option '%s' from table\n", NONULL (ptr->option))); p_delete(&ptr->option); p_delete(&s); p_delete(&ptr->init); @@ -1772,19 +1733,6 @@ static int check_num (const char* option, unsigned long p, return (1); } -#ifdef DEBUG -static int check_debug (const char* option, unsigned long p, - char* errbuf, ssize_t errlen) { - if ((int) p <= DEBUG_MAX_LEVEL && - (int) p >= DEBUG_MIN_LEVEL) - return (1); - - if (errbuf) - snprintf (errbuf, errlen, _("'%d' is invalid for $%s"), (int) p, option); - return (0); -} -#endif - static int check_history (const char* option __attribute__ ((unused)), unsigned long p, char* errbuf, ssize_t errlen) { if (!check_num ("history", p, errbuf, errlen)) @@ -1884,7 +1832,6 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, /* there's no option named like this yet so only add one * if the action isn't any of: reset, unset, query */ if (!(reset || unset || query || *s->dptr != '=')) { - debug_print (1, ("adding user option '%s'\n", tmp->data)); option = add_user_option (tmp->data); hash_insert (ConfigOptions, option->option, option, 0); } @@ -2092,8 +2039,6 @@ static int source_rc (const char *rcfile, BUFFER * err) ssize_t buflen; pid_t pid; - debug_print (2, ("reading configuration file '%s'.\n", rcfile)); - if ((f = mutt_open_read (rcfile, &pid)) == NULL) { snprintf (err->data, err->dsize, "%s: %s", rcfile, strerror (errno)); return (-1); @@ -2191,8 +2136,6 @@ int mutt_parse_rc_line ( /* const */ char *line, BUFFER * token, BUFFER * err) *err->data = 0; - debug_print (1, ("expand '%s'\n", line)); - expn.dptr = vskipspaces(expn.dptr); while (*expn.dptr) { if (*expn.dptr == '#') @@ -2627,8 +2570,6 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) Shell = m_strdup((p = getenv ("SHELL")) ? p : "/bin/sh"); } - debug_start(Homedir); - /* And about the host... */ uname (&utsname); /* some systems report the FQDN instead of just the hostname */ @@ -2720,9 +2661,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) if ((p = getenv ("EMAIL")) != NULL) From = rfc822_parse_adrlist (NULL, p); - mutt_set_langinfo_charset (); - mutt_set_charset (Charset); - + charset_initialize(); /* Set standard defaults */ hash_map (ConfigOptions, mutt_set_default, 0);