hyphenated Unix user names

Fix for $USER, $LOGNAME, getlogin() values that have dashes in them:
keep dash and whatever follows as part of the name instead of stripping
it off for role/race/gender/alignment.

Before:
% USER=test-bar-fem ./nethack
|Shall I pick your female Barbarian's race and alignment for you?
and character ended up named 'test'.

After:
% USER=test-bar-fem ./nethack
|Shall I pick character's race, role, gender and alignment for you?
and character ends up named 'test-bar-fem'.  However,
% ./nethack -u test-bar-fem
still behaves like the 'before' case.
|Shall I pick your female Barbarian's race and alignment for you?

Dash handling is only changed when the dash comes from user name (or
from envionment overriding user name), not from direct player input
or run-time config file.
This commit is contained in:
PatR
2020-05-12 16:38:12 -07:00
parent 1afa961416
commit 41ae223585
6 changed files with 26 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ $NHDT-Date: 1589322383 2020/05/12 22:26:23 $
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.218 $ $NHDT-Date: 1589323704 2020/05/12 22:48:24 $
General Fixes and Modified Features
-----------------------------------
@@ -254,6 +254,9 @@ msdos: Add -DSTATUES_LOOK_LIKE_MONSTERS to Makefile1.cross so the VESA mode
can display statue glyphs.
tty: role and race selection menus weren't filtering out potential choices
which got excluded by OPTIONS=align:!lawful or !neutral or !chaotic
Unix: when user name is used as default character name, keep hyphenated value
intact instead stripping off dash and whatever follows as if that
specified role/race/&c (worked once upon a time; broken since 3.3.0)
windows: update for new status condition fields
X11: substantial overhaul of status display, both 'fancy' and 'tty-style'
X11: extend fancy status one-turn inverse video status-change highlighting to