github pull request #235 - curses symbol set init

Fixes #235

For initial options under curses, specifying 'DECgraphics' as a
boolean rather than as 'symset:DECgraphics' wasn't overriding the
new default 'symset:curses'.  Since previously DECgraphics was
rejected for curses, it's possible that no one noticed.
This commit is contained in:
PatR
2019-10-17 14:38:45 -07:00
parent 0c86965d5e
commit 6182b014ca
5 changed files with 17 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1571313652 2019/10/17 12:00:52 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.253 $ */
/* NetHack 3.6 files.c $NHDT-Date: 1571347976 2019/10/17 21:32:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.254 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3168,9 +3168,11 @@ int which_set;
{
FILE *fp;
symset[which_set].explicitly = FALSE;
if (!(fp = fopen_sym_file()))
return 0;
symset[which_set].explicitly = TRUE;
symset_count = 0;
chosen_symset_start = chosen_symset_end = FALSE;
symset_which_set = which_set;
@@ -3190,7 +3192,14 @@ int which_set;
|| !strcmpi(symset[which_set].name, "default")))
clear_symsetentry(which_set, TRUE);
config_error_done();
return (symset[which_set].name == 0) ? 1 : 0;
/* If name was defined, it was invalid... Then we're loading fallback */
if (symset[which_set].name) {
symset[which_set].explicitly = FALSE;
return 0;
}
return 1;
}
if (!chosen_symset_end)
config_error_add("Missing finish for symset \"%s\"",