]> granicus.if.org Git - nethack/commitdiff
Fix GENERIC_USERNAMES thinko
authorPasi Kallinen <paxed@alt.org>
Tue, 10 Mar 2015 15:30:24 +0000 (17:30 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 10 Mar 2015 15:30:24 +0000 (17:30 +0200)
src/role.c

index 2e2cbabae666d6a5f6093be3c0fcad91db8f19e7..9e09d448aef0adfb1b47b302f89f69fc9639ed33 100644 (file)
@@ -1337,8 +1337,9 @@ plnamesuffix()
     i = (int)strlen(plname);
     eptr = GENERIC_USERNAMES;
     sptr = strstri(eptr, plname);
-    if (sptr && ((sptr == eptr && (sptr[i] == ' ' || sptr[i] == '\0'))
-                || sptr[i] == ' ' || sptr[i] == '\0'))
+    if (sptr
+       && (sptr == eptr || sptr[-1] == ' ')
+       && (sptr[i] == ' ' || sptr[i] == '\0'))
        *plname = '\0'; /* call askname() */
 #endif