+# FreeBSD 9's tput(1) doesn't handle terminfo capabilities, so fall
+# back to termcap capability codes. Its tigetstr(3X) does handle
+# them, so the nmh curses support, including etc/scan.curses, works
+# just fine.
+if tput -Txterm-color sgr0 >/dev/null 2>&1; then
+ standout_code=smso
+ bold_code=bold
+ reset_code=sgr0
+ foreground_code=setaf
+elif tput -Txterm-color me >/dev/null 2>&1; then
+ standout_code=so
+ bold_code=md
+ reset_code=me
+ foreground_code=AF
+else
+ test_skip "unable to use terminfo or termcap capabilities"
+fi
+
+tput -Txterm-color ${reset_code} >/dev/null 2>&1 ||