From: Pasi Kallinen Date: Tue, 10 Mar 2015 15:30:24 +0000 (+0200) Subject: Fix GENERIC_USERNAMES thinko X-Git-Tag: NetHack-3.6.0_RC01~616^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0a335da2a039a0aed69671830df89819b47d0ab;p=nethack Fix GENERIC_USERNAMES thinko --- diff --git a/src/role.c b/src/role.c index 2e2cbabae..9e09d448a 100644 --- a/src/role.c +++ b/src/role.c @@ -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