Author: glen
Date: Sun Sep 17 17:15:22 2006
New Revision: 7766

Modified:
   rc-scripts/trunk/rc.d/init.d/functions
Log:
Avoid overwriting global NLS_DOMAIN if can do without.

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      Sun Sep 17 17:15:22 2006
@@ -233,16 +233,14 @@
 # National language support function
 nls()
 {
-       typeset msg_echo old_nls_domain text message
+       typeset msg_echo nls_domain text message
        msg_echo='\n'
-       old_nls_domain="$NLS_DOMAIN"
-       # parse command line
-       # don't use -o instead || here - this will break ksh --misiek
+       nls_domain="$NLS_DOMAIN"
        while [ "$1" != "${1##-}" ] || [ "$1" != "${1##+}" ]; do
                case "$1" in
                  --nls-domain)
                        shift
-                       NLS_DOMAIN="$1"
+                       nls_domain="$1"
                        shift
                        ;;
                  -n)
@@ -253,9 +251,9 @@
        done
        message="$1"
        shift
+
        # empty message, so we return --misiek
        if [ -z "$message" ]; then
-               NLS_DOMAIN="$old_nls_domain"
                echo -en "$msg_echo"
                return
        fi
@@ -263,14 +261,13 @@
        if is_yes "$FASTRC"; then
                printf "$message" "$@"
        elif is_yes "$GETTEXT"; then
-               text=$(TEXTDOMAINDIR="/etc/sysconfig/locale" gettext -e 
--domain="${NLS_DOMAIN:-rc-scripts}" "$message")
+               text=$(TEXTDOMAINDIR="/etc/sysconfig/locale" gettext -e 
--domain="${nls_domain:-rc-scripts}" "$message")
                printf "$text" "$@"
        else
                printf "$message" "$@"
        fi
 
        echo -en "$msg_echo"
-       NLS_DOMAIN="$old_nls_domain"
 }
 
 rc_splash()
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to