diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 90c72210b..2ae5ba3bb 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -139,6 +139,7 @@ linux: add example use of nroff on recent Linux distros linux: use random() by default instead of lrand48() OpenBSD: time() prototype and correct default Mail program Gnome: compilation problems on Solaris +unix: better error message for .nethackrc access problems General New Features diff --git a/src/files.c b/src/files.c index cd1089cf6..32e2ab678 100644 --- a/src/files.c +++ b/src/files.c @@ -1553,11 +1553,18 @@ const char *filename; } # endif if (errno != ENOENT) { - /* e.g., problems when setuid NetHack can't search home - * directory restricted to user */ - raw_printf("Couldn't open default config file %s (%d).", - tmp_config, errno); - wait_synch(); + char *details; + + /* e.g., problems when setuid NetHack can't search home + * directory restricted to user */ + +#if defined(POSIX_TYPES) || defined(BSD) || defined(SYSV) + if ((details = strerror(errno)) == 0) +#endif + details = ""; + raw_printf("Couldn't open default config file %s %s(%d).", + tmp_config, details, errno); + wait_synch(); } # endif #endif