support 'nethack --nethackrc=~/File'

Substitute $HOME/File if command line specifies --nethackrc=~/File
to avoid "Access to ~/File denied (2)".

Only implemented for opening run-time config file on Unix.  Works for
NETHACKOPTIONS=@~/File too; the normally optional at-sign is required
since the tilde won't match a slash to distinguish file versus options.

Only supports "~/" file path prefix, not "~user/".
This commit is contained in:
PatR
2025-09-22 14:47:54 -07:00
parent 9b7b2421ac
commit d0b79912ed
2 changed files with 9 additions and 0 deletions

View File

@@ -2479,6 +2479,8 @@ Unix: add ../include/nhlua.h to the alloc.o dependencies in Makefile.utl to
Unix: implement SELF_RECOVER compile-time option, on by default on linux
Unix: allow build to succeed with musl (instead of glibc), by specifying
musl=1 on the make command line
Unix: support tilde expansion for home directory path, "~/relative-path", in
command line --nethackrc=path and environment NETHACKOPTIONS=@path
user_sounds: move the message hook from inside individual window display ports
to the core where it allows MSGTYP_NOSHOW msgtyp's to still trigger
sounds to correct a reported github issue; also fixes a past reported