post-3.6 bug: scrambled dip message

Reported directly to devteam:  constructing a verb by applying
"ing" to "dip <item> into" (when attempting to dip into '-')
didn't work too well.  It yielded
 |You mime dip <item> intoing something.
instead of
 |You mime dipping <item> into something.
This commit is contained in:
PatR
2021-03-15 01:10:39 -07:00
parent f008319c5d
commit 98d381de46
2 changed files with 17 additions and 8 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.475 $ $NHDT-Date: 1615760296 2021/03/14 22:18:16 $ NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.476 $ $NHDT-Date: 1615794750 2021/03/15 07:52:30 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -538,6 +538,8 @@ change wizard mode command #wizmgender to wizard mode option 'wizmgender'
engraving with non-blade dulled the weapon anyway (pr #464) engraving with non-blade dulled the weapon anyway (pr #464)
'sortdiscoveries:s' had a spurious generic header shown at the start of the 'sortdiscoveries:s' had a spurious generic header shown at the start of the
last class if there were any artifacts or unique items discovered last class if there were any artifacts or unique items discovered
after getobj refactor: "#dip <item> into -" produced a scrambled message:
You mime dip <item> intoing something.
curses: 'msg_window' option wasn't functional for curses unless the binary curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support also included tty support
+14 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 invent.c $NHDT-Date: 1614474790 2021/02/28 01:13:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.320 $ */ /* NetHack 3.7 invent.c $NHDT-Date: 1615794750 2021/03/15 07:52:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.324 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */ /*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1413,22 +1413,29 @@ static void
mime_action(const char *word) mime_action(const char *word)
{ {
char buf[BUFSZ]; char buf[BUFSZ];
char *bp = buf; char *bp, *pfx, *sfx;
char *suf = (char *) 0;
Strcpy(buf, word);
bp = pfx = sfx = (char *) 0;
strcpy(buf, word);
if ((bp = strstr(buf, " on the ")) != 0) { if ((bp = strstr(buf, " on the ")) != 0) {
/* rub on the stone[s] */ /* rub on the stone[s] */
*bp = '\0'; *bp = '\0';
suf = (bp + 1); sfx = (bp + 1); /* "something <sfx>" */
}
if (!strncmp(buf, "dip ", 4) && strstr(buf + 4, " into")) {
/* "dip <foo> into" => "dipping <foo> into" */
buf[3] = '\0';
pfx = &buf[4]; /* "<pfx> something" */
} }
if ((bp = strstr(buf, " or ")) != 0) { if ((bp = strstr(buf, " or ")) != 0) {
*bp = '\0'; *bp = '\0';
bp = (rn2(2) ? buf : (bp + 4)); bp = (rn2(2) ? buf : (bp + 4));
} else } else
bp = buf; bp = buf;
You("mime %s something%s%s.", ing_suffix(bp), suf ? " " : "",
suf ? suf : ""); You("mime %s%s%s something%s%s.", ing_suffix(bp),
pfx ? " " : "", pfx ? pfx : "", sfx ? " " : "", sfx ? sfx : "");
} }
/* getobj callback that allows any object - but not hands. */ /* getobj callback that allows any object - but not hands. */