From d5d6a3e02d344ed4097a38f54ccf6757e627a1f6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 11 Nov 2018 09:05:03 -0500 Subject: [PATCH] Handle a bare numeric token on the command line a bit more gracefully. --- NEWS | 1 + main.c | 4 ++++ notes.adoc | 3 +++ 3 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 18df431..c186b2e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ Repository head:: Fix for a minor bug in inventory handling. + Handle a bare numeric token on the command line a bit more gracefully. 1.4: 2017-08-07:: Repair packaging error (omitted templates.) diff --git a/main.c b/main.c index c1ebe0e..198a4cc 100644 --- a/main.c +++ b/main.c @@ -1179,6 +1179,10 @@ Lookup: command.verb = command.word[0].id; break; case NUMERIC: // LCOV_EXCL_LINE + if (!settings.oldstyle) { + sspeak(DONT_KNOW, command.word[0].raw); + goto Lclearobj; + } default: // LCOV_EXCL_LINE BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE } diff --git a/notes.adoc b/notes.adoc index 4119d61..c1b5c84 100644 --- a/notes.adoc +++ b/notes.adoc @@ -76,6 +76,9 @@ Unrecognized words are no longer truncated to 5 characters and uppercased when they are echoed. The "-o" (oldstyle) option restores this behavior. +Typing a numeric liteteral to the command prompt no longer triggers a +fatal error. This change is reverted by the oldstyle option. + A "seed" command has been added. This is not intended for human use but as a way for game logs to set the PRNG (pseudorandom-number generator) so that random events (dwarf & pirate appearances, the bird's magic word) -- 2.31.1