#include <lib-lib/macros.h>
#include <lib-lib/buffer.h>
#include <lib-lib/mapping.h>
-#include <lib-lib/debug.h>
#include <lib-lib/rx.h>
#include <lib-sys/unix.h>
/* 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,
#endif
{ "history", check_history },
{ "pager_index_lines", check_num },
-#ifdef DEBUG
- { "debug_level", check_debug },
-#endif
/* last */
{ NULL, NULL }
};
ssize_t l = 0;
if (!(option = hash_find (ConfigOptions, val))) {
- debug_print (1, ("var '%s' not found\n", val));
*dst = '\0';
return (0);
}
/* 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);
}
memcpy (dst, t, l+1);
p_delete(&tmp);
- debug_print (1, ("stripped == '%s'\n", dst));
return (1);
}
/* 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;
}
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;
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);
{
alias_t *tmp = Aliases;
alias_t *last = NULL;
- const char *estr = NULL;
+ char *estr = NULL;
if (!MoreArgs (s)) {
m_strcpy(err->data, err->dsize, _("alias: no address"));
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))
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;
if (mutt_addrlist_to_idna (tmp->addr, &estr)) {
snprintf (err->data, err->dsize,
_("Warning: Bad IDN '%s' in alias '%s'.\n"), estr, tmp->name);
+ p_delete(&estr);
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;
}
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)
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);
}
/* check whether value for $dsn_notify would be valid */
-static int check_dsn_notify (const char* option, unsigned long p,
+static int check_dsn_notify (const char* option __attribute__ ((unused)), unsigned long p,
char* errbuf, ssize_t errlen) {
list2_t* list = NULL;
ssize_t i = 0;
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))
/* 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);
}
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);
*err->data = 0;
- debug_print (1, ("expand '%s'\n", line));
-
expn.dptr = vskipspaces(expn.dptr);
while (*expn.dptr) {
if (*expn.dptr == '#')
const char *p;
char buffer[STRING], error[STRING];
int default_rc = 0, need_pause = 0;
- unsigned int i;
+ int i;
BUFFER err;
p_clear(&err, 1);
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 */
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);