Author: baggins
Date: Tue Oct 25 13:58:26 2005
New Revision: 6477

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
- better detection of tput functionality


Modified: rc-scripts/trunk/rc.d/init.d/functions
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/functions      (original)
+++ rc-scripts/trunk/rc.d/init.d/functions      Tue Oct 25 13:58:26 2005
@@ -136,8 +136,16 @@
 # Colors workaround
 termput()
 {
-       if is_yes "$FASTRC" || [ ! -d /usr/share/terminfo ] || \
-          [ ! -x /usr/bin/tput -a ! -x /bin/tput ]; then
+       typeset tputavail
+
+       if [ -d /usr/share/terminfo ] && [ -x /usr/bin/tput -o -x /bin/tput ] ; 
then
+               tputavail=yes
+               # check if we are on proper terminal
+               tput longname >/dev/null 2>&1 || tputavail=no
+       else
+               tputavail=no
+       fi
+       if is_yes "$FASTRC" || is_no "$tputavail"
                case "$1" in
                  hpa)
                        echo -ne "\033[$(($2+1))G"
@@ -162,9 +170,6 @@
                        ;;
                esac
        else
-               # check if we are on proper terminal
-               tput longname > /dev/null 2>&1 || return
-
                case "$1" in
                  hpa | cuu* | el)
                        tput "$@"
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to