X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=init.c;h=1fc39f21a937027f08146313659e2e1b70eedbb3;hb=5afe120070189b5a78a5af1c539341ebfae4c721;hp=419d892ef62af9378cbd4c6f9a9eb2ef430a3c8e;hpb=189d7d65c27f269b7d85473483488cc6ebbf12f5;p=apps%2Fmadmutt.git diff --git a/init.c b/init.c index 419d892..1fc39f2 100644 --- a/init.c +++ b/init.c @@ -88,6 +88,10 @@ 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, size_t errlen); +#ifdef DEBUG +static int check_debug (const char* option, unsigned long val, + char* errbuf, size_t errlen); +#endif /* use this to check only */ static int check_special (const char* option, unsigned long val, @@ -109,6 +113,9 @@ static struct { #endif { "history", check_history }, { "pager_index_lines", check_num }, +#ifdef DEBUG + { "debug_level", check_debug }, +#endif /* last */ { NULL, NULL } }; @@ -1412,6 +1419,19 @@ 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, size_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, unsigned long p, char* errbuf, size_t errlen) { if (!check_num ("history", p, errbuf, errlen)) @@ -2419,7 +2439,7 @@ void mutt_init (int skip_sys_rc, LIST * commands) /* Read the user's initialization file. */ if (access (Muttrc, F_OK) != -1) { if (!option (OPTNOCURSES)) - endwin (); + mutt_endwin (NULL); if (source_rc (Muttrc, &err) != 0) { fputs (err.data, stderr); fputc ('\n', stderr);