From 39a0c5ee38ba4131f3d27233c483211cc68fc7ec Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 10 Jun 2021 12:12:31 -0400 Subject: [PATCH] nethack --showpaths output tweak Don't display a portable_device_path in --showpaths output if it is empty or not being used. --- src/files.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index eff4e04fd..6e5869dca 100644 --- a/src/files.c +++ b/src/files.c @@ -4323,8 +4323,13 @@ reveal_paths(void) if (sysopt.portable_device_paths) { const char *pd = get_portable_device(); - raw_printf("portable_device_paths (set in sysconf):"); - raw_printf(" \"%s\"", pd); + /* an empty value for pd indicates that portable_device_paths + got set TRUE in a sysconf file other than the one containing + the executable; disregard it */ + if (strlen(pd) > 0) { + raw_printf("portable_device_paths (set in sysconf):"); + raw_printf(" \"%s\"", pd); + } } #endif