X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=7d2f1e61cc301779cd2ff01d5dff338b012dc1a3;hp=419d892ef62af9378cbd4c6f9a9eb2ef430a3c8e;hb=e50c7d0699ab00db55114137b02c93a0a7a7e046;hpb=189d7d65c27f269b7d85473483488cc6ebbf12f5 diff --git a/init.c b/init.c index 419d892..7d2f1e6 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))