summaryrefslogtreecommitdiffstats
path: root/contrib/ncurses/progs/MKtermsort.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/progs/MKtermsort.sh')
-rwxr-xr-xcontrib/ncurses/progs/MKtermsort.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/contrib/ncurses/progs/MKtermsort.sh b/contrib/ncurses/progs/MKtermsort.sh
index 5486fd7..c3495c4 100755
--- a/contrib/ncurses/progs/MKtermsort.sh
+++ b/contrib/ncurses/progs/MKtermsort.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: MKtermsort.sh,v 1.6 2000/01/25 11:35:36 tom Exp $
+# $Id: MKtermsort.sh,v 1.7 2001/05/26 23:37:57 tom Exp $
#
# MKtermsort.sh -- generate indirection vectors for the various sort methods
#
@@ -15,6 +15,11 @@ export LC_ALL
AWK=${1-awk}
DATA=${2-../include/Caps}
+data=data$$
+trap 'rm -f $data' 1 2 5 15
+sed -e 's/[ ]\+/ /g' < $DATA >$data
+DATA=$data
+
echo "/*";
echo " * termsort.c --- sort order arrays for use by infocmp.";
echo " *";
@@ -104,24 +109,26 @@ echo "";
echo "static const bool bool_from_termcap[] = {";
$AWK <$DATA '
-$3 == "bool" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "bool" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
+$3 == "bool" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "bool" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
'
echo "};";
echo "";
echo "static const bool num_from_termcap[] = {";
$AWK <$DATA '
-$3 == "num" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "num" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
+$3 == "num" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "num" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
'
echo "};";
echo "";
echo "static const bool str_from_termcap[] = {";
$AWK <$DATA '
-$3 == "str" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
-$3 == "str" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
+$3 == "str" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";}
+$3 == "str" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";}
'
echo "};";
echo "";
+
+rm -f $data
OpenPOWER on IntegriCloud