]> granicus.if.org Git - nethack/commitdiff
during engraving, spaces were counted instead of non-spaces
authornhmall <nhmall@nethack.org>
Sat, 6 Feb 2021 23:49:16 +0000 (18:49 -0500)
committernhmall <nhmall@nethack.org>
Sat, 6 Feb 2021 23:49:16 +0000 (18:49 -0500)
2015 commit 27d8b631cd5b628577194b689b6182a8b4fc4bae incorrectly altered a test

/* Chop engraving down to size if necessary */
if (len > maxelen) {
    for (sp = ebuf; (maxelen && *sp); sp++)
-> if (!isspace(*sp)) maxelen--;
    if (!maxelen && *sp) {
*sp = (char)0;
if (multi) nomovemsg = "You cannot write any more.";

was changed to:

/* Chop engraving down to size if necessary */
        if (len > maxelen) {
    for (sp = ebuf; (maxelen && *sp); sp++)
-> if (*sp == ' ') maxelen--;
    if (!maxelen && *sp) {
*sp = (char)0;
if (multi) nomovemsg = "You cannot write any more.";

Fixes #457

doc/fixes37.0
src/engrave.c

index 2503a1b224a2c0c8df4d5f222eae907dd1ea5e1f..f7dc5b31bf324c8a6fad95d5c2e5ce4de830d220 100644 (file)
@@ -379,6 +379,7 @@ prevent wish request "death wand" from matching Death monster and producing a
        random wand instead of a wand of death
 grammar bit: "you hear a [AEF] note squeak in the distance" (should be "an")
 curses interface failed to honor menu_xxx option settings for menu interaction
+during engraving, spaces were counted instead of non-spaces
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index f098b460749f41fae0322037f16dc860891d96a2..083698c659c91f89a31d80a60171737bfd65e3c2 100644 (file)
@@ -1143,7 +1143,7 @@ doengrave(void)
     /* Chop engraving down to size if necessary */
     if (len > maxelen) {
         for (sp = ebuf; maxelen && *sp; sp++)
-            if (*sp == ' ')
+            if (!(*sp == ' '))
                 maxelen--;
         if (!maxelen && *sp) {
             *sp = '\0';