applying a book to check readability treated novels as if they were spellbooks
#version was leaving the 'in_lua' flag set and if subsequent 'O' issued an
error (example was an attempt to interactively set bouldersym to an
- invalid value), the error routine reporting crashed via segfault
+ invalid value), the error reporting routine crashed via segfault
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
config_error_init(boolean from_file, const char *sourcename, boolean secure)
{
struct _config_error_frame *tmp = (struct _config_error_frame *)
- alloc(sizeof (struct _config_error_frame));
+ alloc(sizeof *tmp);
tmp->line_num = 0;
tmp->num_errors = 0;
if (!buf || !*buf)
buf = "Unknown error";
+ if (!g.program_state.config_error_ready) {
+ /* either very early, where pline() will use raw_print(), or
+ player gave bad value when prompted by interactive 'O' command */
+ pline("%s%s.", !iflags.window_inited ? "config_error_add: " : "", buf);
+ wait_synch();
+ return;
+ }
+
if (iflags.in_lua) {
struct _config_error_errmsg *dat
= (struct _config_error_errmsg *) alloc(sizeof *dat);
return;
}
- if (!config_error_data) {
- /* either very early, where pline() will use raw_print(), or
- player gave bad value when prompted by interactive 'O' command */
- pline("%s%s.", !iflags.window_inited ? "config_error_add: " : "", buf);
- wait_synch();
- return;
- }
-
config_error_data->num_errors++;
if (!config_error_data->origline_shown && !config_error_data->secure) {
pline("\n%s", config_error_data->origline);
return 0;
n = config_error_data->num_errors;
if (n) {
- pline("\n%d error%s in %s.\n", n,
- (n > 1) ? "s" : "",
- *config_error_data->source
- ? config_error_data->source : configfile);
+ pline("\n%d error%s in %s.\n", n, plur(n),
+ *config_error_data->source ? config_error_data->source
+ : configfile);
wait_synch();
}
config_error_data = tmp->next;
free(tmp);
- g.program_state.config_error_ready = FALSE;
+ g.program_state.config_error_ready = (config_error_data != 0);
return n;
}