diff --git a/src/mdlib.c b/src/mdlib.c index d42ee02b8..59b94b459 100644 --- a/src/mdlib.c +++ b/src/mdlib.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mdlib.c $NHDT-Date: 1593953352 2020/07/05 12:49:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.9 $ */ +/* NetHack 3.7 mdlib.c $NHDT-Date: 1596567095 2020/08/04 18:51:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -63,7 +63,9 @@ static char *FDECL(bannerc_string, (char *, const char *)); static int FDECL(case_insensitive_comp, (const char *, const char *)); static void NDECL(make_version); static char *FDECL(eos, (char *)); +#if 0 static char *FDECL(mdlib_strsubst, (char *, const char *, const char *)); +#endif #endif /* MAKEDEFS_C || FOR_RUNTIME */ #if !defined(MAKEDEFS_C) && defined(WIN32) extern int GUILaunched; @@ -118,6 +120,11 @@ static struct win_info window_opts[] = { #ifdef QT_GRAPHICS /* too vague; there are multiple incompatible versions */ { "Qt", "Qt", TRUE }, #endif +#ifdef MSWIN_GRAPHICS /* win32 */ + { "mswin", "Windows GUI", TRUE }, +#endif + +#if 0 /* remainder have been retired */ #ifdef GNOME_GRAPHICS /* unmaintained/defunct */ { "Gnome", "Gnome", TRUE }, #endif @@ -130,12 +137,10 @@ static struct win_info window_opts[] = { #ifdef GEM_GRAPHICS /* defunct Atari interface */ { "Gem", "Gem", TRUE }, #endif -#ifdef MSWIN_GRAPHICS /* win32 */ - { "mswin", "mswin", TRUE }, -#endif #ifdef BEOS_GRAPHICS /* unmaintained/defunct */ { "BeOS", "BeOS InterfaceKit", TRUE }, #endif +#endif /* 0 => retired */ { 0, 0, FALSE } }; @@ -345,6 +350,7 @@ char *str; return str; } +#if 0 static char * mdlib_strsubst(bp, orig, replacement) char *bp; @@ -363,6 +369,7 @@ const char *orig, *replacement; } return bp; } +#endif static char save_bones_compat_buf[BUFSZ]; @@ -615,8 +622,7 @@ int *length_p; /* in/out */ } else { Sprintf(eos(optbuf), " "), (*length_p)++; } - Sprintf(eos(optbuf), - "%s", str), *length_p += (int) strlen(str); + Sprintf(eos(optbuf), "%s", str), *length_p += (int) strlen(str); str += strlen(str) + (word ? 1 : 0); } } @@ -694,23 +700,24 @@ build_options() Sprintf(eos(buf), " (%s)", window_opts[i].name); /* * 1 : foo. - * 2 : foo and bar (note no period; comes from 'with default' below) - * 3+: for, bar, and quux + * 2 : foo and bar, + * 3+: for, bar, and quux, + * + * 2+ will be followed by " with a default of..." */ - if (cnt != (winsyscnt - 1)) { - Strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */ - : (winsyscnt == 2 && cnt == 0) ? " and" - : (cnt == winsyscnt - 2) ? ", and" - : ","); - } + Strcat(buf, (winsyscnt == 1) ? "." /* no 'default' */ + : (winsyscnt == 2 && cnt == 0) ? " and" + : (cnt == winsyscnt - 2) ? ", and" + : ","); opt_out_words(buf, &length); cnt++; } if (cnt > 1) { - Sprintf(buf, ", with a default of \"%s\".", defwinsys); + /* loop ended with a comma; opt_out_words() will insert a space */ + Sprintf(buf, "with a default of \"%s\".", defwinsys); opt_out_words(buf, &length); } - (void) mdlib_strsubst(optbuf, " , ", ", "); + opttext[idxopttext] = strdup(optbuf); if (idxopttext < (MAXOPT - 1)) idxopttext++;