Bugfix.
* mailbox/cfg_parser.y (mu_cfg_format_error): Raise mu_cfg_error_count only if level is less or equal to error. (_scan_tree_helper): "unknown section" is a warning.
Showing
2 changed files
with
15 additions
and
4 deletions
1 | 2008-11-12 Sergey Poznyakoff <gray@gnu.org.ua> | 1 | 2008-11-12 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 2 | ||
3 | * mailbox/cfg_parser.y (mu_cfg_format_error): Raise | ||
4 | mu_cfg_error_count only if level is less or equal to error. | ||
5 | (_scan_tree_helper): "unknown section" is a warning. | ||
6 | |||
3 | * configure.ac, NEWS: Version 1.9.93. | 7 | * configure.ac, NEWS: Version 1.9.93. |
4 | * include/mailutils/libargp.h (mu_app_cfg_verifier): New extern. | 8 | * include/mailutils/libargp.h (mu_app_cfg_verifier): New extern. |
5 | * libargp/muinit.c (mu_app_cfg_verifier): New variable. | 9 | * libargp/muinit.c (mu_app_cfg_verifier): New variable. | ... | ... |
... | @@ -99,18 +99,24 @@ mu_cfg_format_error (mu_debug_t debug, size_t level, const char *fmt, ...) | ... | @@ -99,18 +99,24 @@ mu_cfg_format_error (mu_debug_t debug, size_t level, const char *fmt, ...) |
99 | mu_debug_vprintf (debug, 0, fmt, ap); | 99 | mu_debug_vprintf (debug, 0, fmt, ap); |
100 | mu_debug_printf (debug, 0, "\n"); | 100 | mu_debug_printf (debug, 0, "\n"); |
101 | va_end (ap); | 101 | va_end (ap); |
102 | if (level <= MU_DEBUG_ERROR) | ||
102 | mu_cfg_error_count++; | 103 | mu_cfg_error_count++; |
103 | } | 104 | } |
104 | 105 | ||
105 | static void | 106 | static void |
107 | _mu_cfg_debug_set_locus (mu_debug_t debug, const mu_cfg_locus_t *loc) | ||
108 | { | ||
109 | mu_debug_set_locus (debug, loc->file ? loc->file : _("unknown file"), | ||
110 | loc->line); | ||
111 | } | ||
112 | |||
113 | static void | ||
106 | _mu_cfg_vperror (mu_debug_t debug, const mu_cfg_locus_t *loc, | 114 | _mu_cfg_vperror (mu_debug_t debug, const mu_cfg_locus_t *loc, |
107 | const char *fmt, va_list ap) | 115 | const char *fmt, va_list ap) |
108 | { | 116 | { |
109 | if (!debug) | 117 | if (!debug) |
110 | mu_diag_get_debug (&debug); | 118 | mu_diag_get_debug (&debug); |
111 | mu_debug_set_locus (debug, | 119 | _mu_cfg_debug_set_locus (debug, loc); |
112 | loc->file ? loc->file : _("unknown file"), | ||
113 | loc->line); | ||
114 | mu_debug_vprintf (debug, 0, fmt, ap); | 120 | mu_debug_vprintf (debug, 0, fmt, ap); |
115 | mu_debug_printf (debug, 0, "\n"); | 121 | mu_debug_printf (debug, 0, "\n"); |
116 | mu_debug_set_locus (debug, NULL, 0); | 122 | mu_debug_set_locus (debug, NULL, 0); |
... | @@ -1148,7 +1154,8 @@ _scan_tree_helper (const mu_cfg_node_t *node, void *data) | ... | @@ -1148,7 +1154,8 @@ _scan_tree_helper (const mu_cfg_node_t *node, void *data) |
1148 | { | 1154 | { |
1149 | if (mu_cfg_parser_verbose) | 1155 | if (mu_cfg_parser_verbose) |
1150 | { | 1156 | { |
1151 | _mu_cfg_perror (sdata->tree->debug, &node->locus, | 1157 | _mu_cfg_debug_set_locus (sdata->tree->debug, &node->locus); |
1158 | mu_cfg_format_error (sdata->tree->debug, MU_DIAG_WARNING, | ||
1152 | _("unknown section `%s'"), | 1159 | _("unknown section `%s'"), |
1153 | node->tag); | 1160 | node->tag); |
1154 | } | 1161 | } | ... | ... |
-
Please register or sign in to post a comment