diff --git a/include/pcconf.h b/include/pcconf.h index 8b580b03a..bdcc8e56b 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -148,9 +148,13 @@ LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \ SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. \ */ - #endif /* MSDOS configuration stuff */ +/* include early argument processing --dumpenums etc. */ +#if defined(MSDOS) +#define PC_EARLY_OPTIONS +#endif + #ifndef PATHLEN #define PATHLEN 64 /* maximum pathlength */ #endif diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 50e7316ab..3f5e2fd5f 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -116,6 +116,10 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ startup(); #endif +#if defined(PC_EARLY_OPTIONS) + program_state.early_options = 1; +#endif + #ifdef TOS if (*argv[0]) { /* only a CLI can give us argv[0] */ gh.hname = argv[0]; @@ -124,6 +128,9 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ #endif gh.hname = "NetHack"; /* used for syntax messages */ +#if defined(PC_EARLY_OPTIONS) + early_init(argc, argv); +#endif choose_windows(DEFAULT_WINDOW_SYS); @@ -266,6 +273,12 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ #endif ami_wininit_data(WININIT); #endif + +#if defined(PC_EARLY_OPTIONS) + early_options(&argc, &argv, &dir); + program_state.early_options = 0; +#endif + initoptions(); #ifdef NOCWD_ASSUMPTIONS diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index c26b1f4ea..9e9f9aab0 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -155,8 +155,11 @@ getreturn(const char *str) msmsg("Hit %s.", str); #endif #endif - while (pgetchar() != '\n') - ; +#if defined(PC_EARLY_OPTIONS) + if (isatty(STDOUT_FILENO)) +#endif + while (pgetchar() != '\n') + ; return; }