From: Eric S. Raymond Date: Thu, 20 Jul 2017 13:50:58 +0000 (-0400) Subject: Eliminate last logic guard on a packed value. X-Git-Tag: 1.3~41 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=08c40bc9993ce5684077b9ceac492e4fb642a722 Eliminate last logic guard on a packed value. --- diff --git a/actions.c b/actions.c index 682b03b..5433a7d 100644 --- a/actions.c +++ b/actions.c @@ -1355,7 +1355,10 @@ int action(struct command_t *command) if (command->raw2[0] != '\0' && command->verb != SAY) return GO_WORD2; if (command->verb == SAY) - command->obj = command->wd2; + /* KEYS is not special, anything not NO_OBJECT or INTRANSITIVE + * will do here. We're preventing interpretation as an intransitive + * verb when the word is unknown. */ + command->obj = command->raw2[0] != '\0' ? KEYS : NO_OBJECT; if (command->obj == NO_OBJECT || command->obj == INTRANSITIVE) { /* Analyse an intransitive verb (ie, no object given yet). */