]> granicus.if.org Git - nethack/commitdiff
more /? of spaces
authorPatR <rankin@nethack.org>
Sat, 4 Jun 2016 13:06:20 +0000 (06:06 -0700)
committerPatR <rankin@nethack.org>
Sat, 4 Jun 2016 13:06:20 +0000 (06:06 -0700)
Restore the ability to look up a single space by 'name'.

I thought mungspaces("<all spaces>") kept one space, but it doesn't.
It's a lucky accident that unnaming monsters and objects still works.
There may be other places which intend to give a special meaning to
a single space that don't still work....

doc/fixes36.1
src/pager.c

index b3d6a6a9fb76007e3bdf1e8dd03d98150b484b31..6b924214808560e33d32efb95c99c78aeecaec1b 100644 (file)
@@ -283,6 +283,8 @@ when poly'd into a hider and engulfed, attempt to hide via #monster was blocked
 various monster/object/food/gold/trap detections were inconsistent in how they
        behaved if performed while engulfed or underwater
 show in inventory which monster a leash is attached to
+using /? to look up something by name, supplying multiple spaces (with no
+       other characters) as the name triggered impossible "singular of null?"
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index 92c72787d631d5b114199176d905ee96f15cd5c5..77ade35b0ed5dee8c67d9cd8fe177eddff214379 100644 (file)
@@ -1060,9 +1060,10 @@ coord *click_cc;
         case '?':
             from_screen = FALSE;
             getlin("Specify what? (type the word)", out_str);
-            /* mungspaces prevents querying for a space glyph (eg. a ghost),
-               but players almost always use '/' instead to look up glyphs */
-            mungspaces(out_str);
+            if (strcmp(out_str, " ")) /* keep single space as-is */
+                /* remove leading and trailing whitespace and
+                   condense consecutive internal whitespace */
+                mungspaces(out_str);
             if (out_str[0] == '\0' || out_str[0] == '\033')
                 return 0;