]> granicus.if.org Git - nethack/commitdiff
fix bz55 - wrong plural for slice of cake
authorPatR <rankin@nethack.org>
Sun, 13 Dec 2015 02:59:21 +0000 (18:59 -0800)
committerPatR <rankin@nethack.org>
Sun, 13 Dec 2015 02:59:21 +0000 (18:59 -0800)
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.

doc/fixes36.1
src/objnam.c

index 65d8a83c6520db39ec350ad20a0df9736e54f23d..7558e464856187c21f8016f4d46336d2d9355339 100644 (file)
@@ -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
index bf68842e74d660d0e59455791f1e16df392269bd..7e3f6aea1d870ba05cd8a58d993d3e9f3bcd3d12 100644 (file)
@@ -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;