diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2026-01-14 12:37:49 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2026-01-14 12:37:49 +0000 |
| commit | c5a1e08b52b2f6c05e0116d46277904b711b6bdb (patch) | |
| tree | a6ad7350d1b1100356ca59616d22c51dd29743eb /test/tput-initc | |
| parent | 24fa7a5107c5b75d1c197accf0305be64bc72882 (diff) | |
Vendor import ncurses 6.6vendor/ncurses/6.6vendor/ncurses
Diffstat (limited to 'test/tput-initc')
| -rwxr-xr-x | test/tput-initc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/tput-initc b/test/tput-initc index 9d71c4f61875..ff3b52acf05a 100755 --- a/test/tput-initc +++ b/test/tput-initc @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2025 Thomas E. Dickey # # Copyright 2016 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -27,14 +27,14 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: tput-initc,v 1.6 2020/02/02 23:34:34 tom Exp $ +# $Id: tput-initc,v 1.7 2025/06/14 14:06:55 tom Exp $ # Some of the ".dat" files in ncurses' test-directory give r/g/b numbers for # default palettes of xterm and Linux console. This script reads the numbers # and (assuming the same or compatible terminal) uses tput to (re)initialize # the palette using those numbers. failed() { - printf "?? $*\n" >&2 + printf "?? %s\n" "$1" >&2 exit 1 } @@ -70,7 +70,7 @@ do ;; esac done -shift $(expr $OPTIND - 1) +shift "$(expr "$OPTIND" - 1)" if [ $# = 1 ] then @@ -93,22 +93,21 @@ then fi myterm=${file%%.dat} -colors=$(tput -T $myterm colors 2>/dev/null) -if [ ${colors:-0} -le 0 ] +colors=$(tput -T "$myterm" colors 2>/dev/null) +if [ "${colors:-0}" -le 0 ] then myterm=${myterm%%-color} - colors=$(tput -T $myterm colors 2>/dev/null) + colors=$(tput -T "$myterm" colors 2>/dev/null) fi -if [ ${colors:-0} -le 0 ] +if [ "${colors:-0}" -le 0 ] then failed "terminal $myterm does not support color" fi -cat $file |\ awk -v opt_r=$opt_r \ -v opt_s=$opt_s \ - -v colors=$colors \ - -v myterm=$myterm ' + -v colors="$colors" \ + -v myterm="$myterm" < "$file" ' BEGIN { limit = 1000; range = -1; |
