From e0bf7a01cc3bb7d2152dcdc247fd8456d199ea60 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 12 Mar 2019 14:11:26 -0700 Subject: [PATCH] nethack.sh: test -e vs test -f Change the test for whether fonts.dir exists (added to the script in 3.6.0, for automatically setting up possible use of the NH10 font under X11) from 'test -e file' to 'test -f file' since the latter seems to be more universally available. When present, fonts.dir is plain text, so a test for "exists and is a regular file" rather than one for general existance is appropriate. --- doc/fixes36.2 | 4 +++- sys/unix/nethack.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index f293fec72..fe465e3e9 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ $NHDT-Date: 1552422652 2019/03/12 20:30:52 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.273 $ $NHDT-Date: 1552425075 2019/03/12 21:11:15 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -517,6 +517,8 @@ unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make' specifically requested; use 'make QUIETCC=1 ' to get the 3.6.1 behavior back unix: add curses window port +unix: in nethack.sh, use 'test -f' instead of 'test -e' when checking for + fonts.dir while running under X11 vms: data file processing and playground setup were missing post-3.4.3 files engrave, epitaph, and bogusmon made from corresponding *.txt windows: Added ntassert() mechanism for Windows based port use diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh index 7ca74865d..2c2b62cdf 100755 --- a/sys/unix/nethack.sh +++ b/sys/unix/nethack.sh @@ -1,5 +1,5 @@ #!/bin/sh -# NetHack 3.6 nethack.sh $NHDT-Date: 1524689450 2018/04/25 20:50:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $ +# NetHack 3.6 nethack.sh $NHDT-Date: 1552425075 2019/03/12 21:11:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ # Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland # NetHack may be freely redistributed. See license for details. @@ -17,7 +17,7 @@ esac export XUSERFILESEARCHPATH # Get font dir added, but only once (and only if there's an xset to be found). -test -n "$DISPLAY" -a -e $HACKDIR/fonts.dir && xset p >/dev/null 2>&1 && ( +test -n "$DISPLAY" -a -f $HACKDIR/fonts.dir && xset p >/dev/null 2>&1 && ( xset fp- $HACKDIR >/dev/null 2>&1; xset fp+ $HACKDIR )