'generic username' checking

Don't require the list of generic usernames in sysconf to need to be
ordered to guard against false substring matches.  If the list was
"nethacker nethack" and the tentative character name was "nethack",
it wouldn't be recognized as generic.  The old code forced the list
to be "nethack nethacker" for the matching to work correctly because
it only checked the first matching substring.  Either order works now.

It also failed to recognize a generic name if the player used
|nethack -u nethack-samurai-human-male-lawful
because it checked for generic names before stripping off the role
aspects.  Now that will at least recognize the name as generic and
prompt with "who are you?", but the role/race/&c info gets discarded.
This commit is contained in:
PatR
2022-12-12 14:53:07 -08:00
parent bc13b52d32
commit cefd9a0c0a
3 changed files with 43 additions and 9 deletions

View File

@@ -1021,6 +1021,7 @@ extern char *tabexpand(char *);
extern char *visctrl(char);
extern char *strsubst(char *, const char *, const char *);
extern int strNsubst(char *, const char *, const char *, int);
extern const char *findword(const char *, const char *, int, boolean);
extern const char *ordin(int);
extern char *sitoa(int);
extern int sgn(int);