]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Avoid overwriting global NLS_DOMAIN if can do without.
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 17 Sep 2006 15:15:22 +0000 (15:15 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Sun, 17 Sep 2006 15:15:22 +0000 (15:15 +0000)
svn-id: @7766

rc.d/init.d/functions

index 077bea03dec23fc3e89c93c1127a34960ecb66fb..ca23c907aaef43a416b45b716a397b4456d069e3 100644 (file)
@@ -233,16 +233,14 @@ fi
 # 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 @@ nls()
        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 @@ nls()
        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()
This page took 0.084563 seconds and 4 git commands to generate.