From 757eca7fd98d8f72be798cde7ee0a5dc9d280826 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 25 Oct 2019 23:11:06 -0700 Subject: [PATCH 1/6] fix github issue #238 - 'scores' option Fixes #238 For the three fields in the 'scores' option's argument: top, around, and own, if any was separated from preceding one by space(s) rather than slash and lacked a count prefix, the argument parsing skipped over it. So "10t/3a/o" and "10t 3a 1o" worked but "10t 3a o" ignored the 'o'. The issue report was about 'own' but there's nothing special about 'own' itself; just that it doesn't warrant a count prefix and is usually last (in other words, normally preceded by one or both of the other two) so more likely to trip over this. [I thought there was another report about 'scores' misbehaving (from quite a while ago) but couldn't find one. If it exists, it might have been about the same thing.] --- doc/fixes36.3 | 5 ++++- src/options.c | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index c8461fcc6..c767a776f 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.145 $ $NHDT-Date: 1571531885 2019/10/20 00:38:05 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.147 $ $NHDT-Date: 1572070254 2019/10/26 06:10:54 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -204,6 +204,9 @@ grammar correction for "That walking shoes is really a small mimic" when applying a stethoscope mimic immitating a slime mold would change fruit type when player assigned new named fruit +parsing for the argument to 'scores' option was sloppy; "3a/o" (slash) and + "3a 1o" (space and digit one, not lowercase L) both worked but "3a o" + (just space) was supposed to but didn't Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/options.c b/src/options.c index f4975688a..64ab1a9ba 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1571448220 2019/10/19 01:23:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.380 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1572070255 2019/10/26 06:10:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.381 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3262,8 +3262,12 @@ boolean tinitial, tfrom_file; config_error_add("Unknown %s parameter '%s'", fullname, op); return FALSE; } - while (letter(*++op) || *op == ' ') - continue; + /* "3a" is sufficient but accept "3around" (or "3abracadabra") */ + while (letter(*op)) + op++; + /* t, a, and o can be separated by space(s) or slash or both */ + while (*op == ' ') + op++; if (*op == '/') op++; } From d201d302b7a95f1e0e03957a36a5737c228c20f8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 26 Oct 2019 19:56:03 +0300 Subject: [PATCH 2/6] Fix wizmakemap leaving genocided monsters on map If a genocided monster was in "limbo" (migrating to the same level), wizmakemap put it back on map. --- doc/fixes36.3 | 1 + src/cmd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index c767a776f..3b9997702 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -207,6 +207,7 @@ mimic immitating a slime mold would change fruit type when player assigned new parsing for the argument to 'scores' option was sloppy; "3a/o" (slash) and "3a 1o" (space and digit one, not lowercase L) both worked but "3a o" (just space) was supposed to but didn't +wizmakemap could leave genocided monsters on map Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/cmd.c b/src/cmd.c index e6c4049b1..e739172d5 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -861,6 +861,7 @@ wiz_makemap(VOID_ARGS) u_on_rndspot((u.uhave.amulet ? 1 : 0) /* 'going up' flag */ | (was_in_W_tower ? 2 : 0)); losedogs(); + kill_genocided_monsters(); /* u_on_rndspot() might pick a spot that has a monster, or losedogs() might pick the hero's spot (only if there isn't already a monster there), so we might have to move hero or the co-located monster */ From d834ebb0ec1ea3e8c6a7399ab7d3af3cf99d784c Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 26 Oct 2019 19:01:49 -0700 Subject: [PATCH 3/6] paranoid_query bulletproofing Make paranoid_query() (yn question requiring explicit "yes" answer) protect itself from overly long prompt strings. I'm not aware of any specific overflowing queries so I temporary reduced QBUFSZ within paranoid_query() in order to test. For EDIT_GETLIN, don't use previous response as default if we loop after neither "yes" nor "no" was given for paranoid confirm. --- doc/fixes36.3 | 4 +++- src/cmd.c | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 3b9997702..1f8077ee2 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.147 $ $NHDT-Date: 1572070254 2019/10/26 06:10:54 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ $NHDT-Date: 1572141706 2019/10/27 02:01:46 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -255,6 +255,8 @@ EDIT_GETLIN: when naming an object or a monster use the existing name, if EDIT_GETLIN: using 'O' to set message types or menu colors was overloading the answer buffer with other stuff, resulting in bogus default response during repeat prompting +EDIT_GETLIN: for paranoid confirmation, if answer was neither "yes" nor "no", + don't supply the rejected answer as the default when retrying curses: very tall menus tried to use selector characters a-z, A-Z, and 0-9, but 0-9 should be reserved for counts and if the display was tall enough for more than 62 entries, arbitrary ASCII punctuation got used diff --git a/src/cmd.c b/src/cmd.c index e739172d5..0d65bb022 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1565574994 2019/08/12 01:56:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.343 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1572141702 2019/10/27 02:01:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.347 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6045,19 +6045,27 @@ const char *prompt; to give the go-ahead for this query; default is "no" unless the ParanoidConfirm flag is set in which case there's no default */ if (be_paranoid) { - char qbuf[QBUFSZ], ans[BUFSZ] = DUMMY; - const char *promptprefix = "", *responsetype = ParanoidConfirm - ? "(yes|no)" - : "(yes) [no]"; - int trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */ + char pbuf[BUFSZ], qbuf[QBUFSZ], ans[BUFSZ]; + const char *promptprefix = "", + *responsetype = ParanoidConfirm ? "(yes|no)" : "(yes) [no]"; + int k, trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */ + copynchars(pbuf, prompt, BUFSZ - 1); /* in addition to being paranoid about this particular query, we might be even more paranoid about all paranoia responses (ie, ParanoidConfirm is set) in which case we require "no" to reject in addition to "yes" to confirm (except we won't loop if response is ESC; it means no) */ do { - Sprintf(qbuf, "%s%s %s", promptprefix, prompt, responsetype); + /* make sure we won't overflow a QBUFSZ sized buffer */ + k = (int) (strlen(promptprefix) + 1 + strlen(responsetype)); + if ((int) strlen(pbuf) + k > QBUFSZ - 1) { + /* chop off some at the end */ + Strcpy(pbuf + (QBUFSZ - 1) - k - 4, "...?"); /* -4: "...?" */ + } + + Sprintf(qbuf, "%s%s %s", promptprefix, pbuf, responsetype); + *ans = '\0'; getlin(qbuf, ans); (void) mungspaces(ans); confirmed_ok = !strcmpi(ans, "yes"); From eef880214becc22d5710562c8dbb568e2c4ad24f Mon Sep 17 00:00:00 2001 From: Bart House Date: Sat, 26 Oct 2019 20:09:14 -0700 Subject: [PATCH 4/6] Modified travis builds to deploy the x86 windows build to github if tagged. Moved the travis visual studio build bash script to live outside of the travis YML file. Updated the script to use powershell to generate ZIP file form the binary results. Deploy Windows build ZIP file to github releases if build has commit has been tagged. Build will be marked pre-release. --- .travis.yml | 50 +++++++++++------------------------- win/win32/vs2017/travisci.sh | 33 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 35 deletions(-) create mode 100644 win/win32/vs2017/travisci.sh diff --git a/.travis.yml b/.travis.yml index 67d05077d..b8750491b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,40 +73,7 @@ matrix: env: DESCR=windows-visualstudio language: shell script: -# - find /c/Program\ Files\ \(x86\) -iname 'rc.exe' -print -# - export - - export VSVER=2017 - - export MSVER=14.16.27023 - - export SDKVER=10.0.17763.0 - - export FRAMEVER=4.0.30319 - - export NETFXVER=4.6.1 - - export WKITVER=10.0.17134.0 -# - export TOOLSVER=Community - - export TOOLSVER=BuildTools - - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/VC/VCPackages:$PATH - - export PATH=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/$WKITVER/x64:$PATH - - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x64:$PATH - - export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x86:$PATH - - export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/CommonExtensions/Microsoft/TestWindow - - export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/MSBuild/Current/bin/Roslyn - - export INCLUDE=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/$TOOLSVER/VC/Tools/MSVC/$MSVER/include - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/Include/$WKITVER/ucrt - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/ucrt - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/shared - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/um - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/winrt - - export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/cppwinrt - - export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/ATLMFC/lib/x86 - - export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/lib/x86:$LIB - - export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/ucrt/x86:$LIB - - export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/um/x86:$LIB -# - export - - git clone --depth 1 https://github.com/wmcbrine/PDCurses.git ../pdcurses - - export ADD_CURSES=Y - - export PDCURSES_TOP=../../pdcurses - - cd src - - cp ../sys/winnt/Makefile.msc ./Makefile - - nmake install + - ./win/win32/vs2017/travisci.sh - os: windows # install: choco install mingw env: DESCR=windows-mingw @@ -128,4 +95,17 @@ sudo: false notifications: email: recipients: - - devteam@nethack.org + - bart@barthouse.com +# +deploy: + provider: releases + api_key: + secure: "U0Dt2CXrcG8Yi4taUCT/6AnM+0IJtdCv6IVG/2rGooUY3pZjNWE9XDM6X9ZeAmbI79aN6FPTppjUf3KbB/upYeJt+8mrjnxEk/ZTO1xXDDW8iL/DiqnczoFsMGmPsTM+Fkeak8bu0SifI7Qkx9i1N+zOyl2VdlaxGjchPfl/OJw2jcQs7rOGRfr23/rapZKTcFq+BFlxMiIHa0dXbCJ9vagdlyAeclOCtPjw1VoH/Cb/+0/Xlx2MFPncw4/1P+bO/fPantHyehh3/WCDVCnI4M7ftONpsTVRrQ+Hml89teUH9/1xXUOpbCeVghWr1rumLcQzMqLKNj2lP/gm9co2/DKpxiUPUzBfO/9Jvl1CNoEwPYQBRNb38kggDvAT4vKX38Oi5sZvumFEO4L0y7o4cW6SA4/CYIykfxOdkrryt8ltfWwopdy3I/DothYw31vJ9GsZOCAShFRAy3hJxYUbHhT+7SDUBadVSEkb4UqxQ+7zntAVT+Lp4DXLAfvsWxZGrQoP/IrWAgNOLRKILubpzh+YpadMH3Ygha2JRAeJAEZ3DnXf3vOOAucWnk4mNXDbW35GTDTAJDWMvddZCfsrUI/uHxgaRjFs9fLX1X5tqhGnsr27sKLWyX+zrIPVV0TPl3AzYPAf6Bc8Okeu+JEGQERvvgSasCuYcmhgYznBVJI=" + file: + - "NetHack.zip" + skip_cleanup: true + on: + tags: true + prerelease: true + name: "Pre-release build of NetHack 3.6.3" + body: "This is auto generated pre-release build of NetHack 3.6.3 and as such has not been tested." diff --git a/win/win32/vs2017/travisci.sh b/win/win32/vs2017/travisci.sh new file mode 100644 index 000000000..6b21a45d4 --- /dev/null +++ b/win/win32/vs2017/travisci.sh @@ -0,0 +1,33 @@ +export VSVER=2017 +export MSVER=14.16.27023 +export SDKVER=10.0.17763.0 +export FRAMEVER=4.0.30319 +export NETFXVER=4.6.1 +export WKITVER=10.0.17134.0 +#export TOOLSVER=Enterprise +export TOOLSVER=BuildTools +export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/VC/VCPackages:$PATH +export PATH=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/$WKITVER/x64:$PATH +export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x64:$PATH +export PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/bin/HostX64/x86:$PATH +export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/Common7/IDE/CommonExtensions/Microsoft/TestWindow +export PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/MSBuild/Current/bin/Roslyn +export INCLUDE=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/$TOOLSVER/VC/Tools/MSVC/$MSVER/include +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/Include/$WKITVER/ucrt +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/ucrt +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/shared +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/um +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/winrt +export INCLUDE=$INCLUDE:/c/Program\ Files\ \(x86\)/Windows\ Kits/10/include/$WKITVER/cppwinrt +export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/ATLMFC/lib/x86 +export LIB=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/$VSVER/$TOOLSVER/VC/Tools/MSVC/$MSVER/lib/x86:$LIB +export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/ucrt/x86:$LIB +export LIB=/c/Program\ Files\ \(x86\)/Windows\ Kits/10/lib/$WKITVER/um/x86:$LIB +git clone --depth 1 https://github.com/wmcbrine/PDCurses.git ../pdcurses +export ADD_CURSES=Y +export PDCURSES_TOP=../../pdcurses +cd src +cp ../sys/winnt/Makefile.msc ./Makefile +nmake install +cd .. +powershell -Command "Compress-Archive -U -LiteralPath binary -DestinationPath NetHack.zip" From 91f783daf611504ba4f84ecd983cc75ee6649ba6 Mon Sep 17 00:00:00 2001 From: Bart House Date: Sat, 26 Oct 2019 20:11:21 -0700 Subject: [PATCH 5/6] Changed travis email to once again send to devteam. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b8750491b..501c0f7df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,7 @@ sudo: false notifications: email: recipients: - - bart@barthouse.com + - devteam@nethack.org # deploy: provider: releases From 2d7901372e7f731f22ed8bb2bf9ca0997ade8c1d Mon Sep 17 00:00:00 2001 From: Bart House Date: Sat, 26 Oct 2019 20:39:24 -0700 Subject: [PATCH 6/6] Change ZIP file layout to be flat. --- win/win32/vs2017/travisci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/win32/vs2017/travisci.sh b/win/win32/vs2017/travisci.sh index 6b21a45d4..09b4b9822 100644 --- a/win/win32/vs2017/travisci.sh +++ b/win/win32/vs2017/travisci.sh @@ -30,4 +30,4 @@ cd src cp ../sys/winnt/Makefile.msc ./Makefile nmake install cd .. -powershell -Command "Compress-Archive -U -LiteralPath binary -DestinationPath NetHack.zip" +powershell -Command "Compress-Archive -U -Path binary/*.* -DestinationPath NetHack.zip"