fix bz55 - wrong plural for slice of cake
Entered in bugzilla prior to release: "slice of birthday cake" became "slouse of birthday cake" when made plural. "slice of pizza" used to work, but adding an entry for "louse" <-> "lice" to one of the special handling lists for singular/plural broke "slice" since only a trailing substring match is performed for entries in that particular list.
This commit is contained in:
@@ -17,6 +17,8 @@ any existing vampire shape-shifted into critter (fog cloud, bat, wolf) became
|
||||
an unkillable critter if vampires were genocided
|
||||
unlike in previous versions, an uncursed scroll of enchant armor failed to
|
||||
uncurse the piece of armor being enchanted (change was unintentional)
|
||||
slice of {pizza,cake,&} pluralized as "slouse of ..." due to false match
|
||||
with "lice" (discovered pre-3.6.0-release)
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
11
src/objnam.c
11
src/objnam.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1449740045 2015/12/10 09:34:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.155 $ */
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1449975408 2015/12/13 02:56:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.156 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1874,6 +1874,15 @@ const char *const *alt_as_is; /* another set like as_is[] */
|
||||
}
|
||||
}
|
||||
|
||||
/* avoid false hit on one_off[].plur == "lice";
|
||||
if more of these turn up, one_off[] entries will need to flagged
|
||||
as to which are whole words and which are matchable as suffices
|
||||
then matching in the loop below will end up becoming more complex */
|
||||
if (!strcmpi(basestr, "slice")) {
|
||||
if (to_plural)
|
||||
(void) strkitten(basestr, 's');
|
||||
return TRUE;
|
||||
}
|
||||
for (sp = one_off; sp->sing; sp++) {
|
||||
/* check whether endstring already matches */
|
||||
same = to_plural ? sp->plur : sp->sing;
|
||||
|
||||
Reference in New Issue
Block a user