]> granicus.if.org Git - nethack/commitdiff
hilite_status: spaces in color names break option parsing
authorAlex Kompel <barbos+nethack@gmail.com>
Mon, 1 Jun 2015 15:20:56 +0000 (08:20 -0700)
committerAlex Kompel <barbos+nethack@gmail.com>
Mon, 1 Jun 2015 15:20:56 +0000 (08:20 -0700)
src/botl.c

index 3ba06f526eb921ede629c3ae99e90aa1086c4fb0..210a21e1392cd484d441586632478b313bbe944e 100644 (file)
@@ -1380,6 +1380,7 @@ char *buf;
 int idx;
 {
     static const char *a[] = { "bold", "inverse", "normal" };
+    char* p = 0;
 
     if (buf) {
         buf[0] = '\0';
@@ -1387,6 +1388,9 @@ int idx;
             Strcpy(buf, a[idx + 3]);
         else if (idx >= 0 && idx < CLR_MAX)
             Strcpy(buf, c_obj_colors[idx]);
+        /* replace spaces with - */
+        for(p = buf; *p; p++)
+            if(*p == ' ') *p = '-';
     }
     return buf;
 }