diff --git a/doc/fixes36.2 b/doc/fixes36.2 index ac5e5af87..7cd1f75f1 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -252,12 +252,14 @@ hero hit by something that causes inventory items to be destroyed with loss of similar problem with more obvious symptom, an "object lost" panic when the unholy water was wielded; the fix for that wasn't general enough] add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo -at start of session (new game or restore), HILITE_STATUS for gold was ignored -if player creates any menu colors via 'O' while menucolors is off, issue a - reminder that it needs to be on in order for those to become effective add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in a couple places that warrant it when a specific monster type isn't specified on the call to makemon() +at start of session (new game or restore), HILITE_STATUS for gold was ignored +if player creates any menu colors via 'O' while menucolors is off, issue a + reminder that it needs to be on in order for those to become effective +setting second or later named fruit to value beginning with two or more spaces + followed by non-space gave "singular of null?" warning Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/options.c b/src/options.c index b3595a6ad..1bf7f7024 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1544174413 2018/12/07 09:20:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.339 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1544396581 2018/12/09 23:03:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.340 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -883,6 +883,8 @@ initoptions_finish() return; } +/* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen; + treat comma as alternate end of 'src' */ STATIC_OVL void nmcpy(dest, src, maxlen) char *dest; @@ -896,7 +898,7 @@ int maxlen; break; /*exit on \0 terminator*/ *dest++ = *src++; } - *dest = 0; + *dest = '\0'; } /* @@ -2583,7 +2585,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); - op = string_for_opt(opts, negated); + op = string_for_opt(opts, negated || !initial); if (negated) { if (op) { bad_negation("fruit", TRUE); @@ -2594,6 +2596,8 @@ boolean tinitial, tfrom_file; } if (!op) return FALSE; + /* 3.6.2: strip leading and trailing spaces, condense internal ones */ + mungspaces(op); if (!initial) { struct fruit *f; int fnum = 0; @@ -4465,7 +4469,7 @@ doset() /* changing options via menu by Per Liboriussen */ /* boolean option */ Sprintf(buf, "%s%s", *boolopt[opt_indx].addr ? "!" : "", boolopt[opt_indx].name); - parseoptions(buf, setinitial, fromfile); + (void) parseoptions(buf, setinitial, fromfile); if (wc_supported(boolopt[opt_indx].name) || wc2_supported(boolopt[opt_indx].name)) preference_update(boolopt[opt_indx].name); @@ -4481,7 +4485,7 @@ doset() /* changing options via menu by Per Liboriussen */ continue; Sprintf(buf, "%s:%s", compopt[opt_indx].name, buf2); /* pass the buck */ - parseoptions(buf, setinitial, fromfile); + (void) parseoptions(buf, setinitial, fromfile); } if (wc_supported(compopt[opt_indx].name) || wc2_supported(compopt[opt_indx].name)) @@ -4639,7 +4643,8 @@ boolean setinitial, setfromfile; destroy_nhwindow(tmpwin); } else if (!strcmp("pickup_types", optname)) { /* parseoptions will prompt for the list of types */ - parseoptions(strcpy(buf, "pickup_types"), setinitial, setfromfile); + (void) parseoptions(strcpy(buf, "pickup_types"), + setinitial, setfromfile); } else if (!strcmp("disclose", optname)) { /* order of disclose_names[] must correspond to disclosure_options in decl.c */