summaryrefslogtreecommitdiff
path: root/app/xterm/vttests/other-sgr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'app/xterm/vttests/other-sgr.sh')
-rw-r--r--app/xterm/vttests/other-sgr.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/xterm/vttests/other-sgr.sh b/app/xterm/vttests/other-sgr.sh
index de253cee0..16aa6b44c 100644
--- a/app/xterm/vttests/other-sgr.sh
+++ b/app/xterm/vttests/other-sgr.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $XTermId: other-sgr.sh,v 1.7 2022/02/13 14:36:10 tom Exp $
+# $XTermId: other-sgr.sh,v 1.9 2022/04/24 23:36:20 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
@@ -38,14 +38,15 @@ CSI="${ESC}["
CMD='/bin/echo'
OPT='-n'
SUF=''
-TMP=`(mktemp) 2>/dev/null` || TMP=/tmp/xterm$$
+: "${TMPDIR=/tmp}"
+TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$"
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
-{ test ! -f $TMP || test -s $TMP; } &&
+{ test ! -f "$TMP" || test -s "$TMP"; } &&
for verb in "printf" "print" ; do
- rm -f $TMP
+ rm -f "$TMP"
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
- if test -f $TMP ; then
- if test ! -s $TMP ; then
+ if test -f "$TMP" ; then
+ if test ! -s "$TMP" ; then
CMD="$verb"
OPT=
SUF='\c'
@@ -53,7 +54,7 @@ for verb in "printf" "print" ; do
fi
fi
done
-rm -f $TMP
+rm -f "$TMP"
trap '$CMD $OPT "${CSI}0m"; exit 1' 1 2 3 15
trap '$CMD $OPT "${CSI}0m"' 0